We decided to change hosting providers due to cost and performance.
Summary
This epic tracks the complete migration of the Torrust Tracker demo from its current environment to a new virtual machine hosted on Hetzner. The goals are:
Torrust Tracker Demo Migration Plan - Digital Ocean to Hetzner
UPDATED ON: 2025-08-07
Overview
This plan outlines the migration of the Torrust Tracker demo from Digital Ocean to Hetzner
infrastructure. The migration prioritizes ease of updates over performance by maintaining
Docker-based deployments, and follows a complete local development and testing approach
before deploying to production.
Key Decisions
- Docker-first approach: Continue using Docker for the tracker to simplify updates
(just pull new images)
- Complete local testing: Finish all development and testing locally before creating
any Hetzner VMs
- MySQL by default: Replace SQLite with MySQL for better production characteristics
- 12-Factor App compliance: Refactor the entire repository to follow modern deployment
practices
Migration Phases
Phase 1: Database Migration to MySQL
Objective: Replace SQLite with MySQL as the default database
Tasks
Validation
Deliverable: Working local deployment with MySQL backend
Phase 2: 12-Factor App Refactoring
Objective: Refactor repository to follow 12-Factor App methodology
Reference: See detailed plan in infrastructure/docs/refactoring/twelve-factor-refactor/
Key Changes
Tasks
Deliverable: 12-Factor compliant repository structure
Phase 3: Complete Application Installation Automation
Objective: Fully automate tracker deployment including SSL certificates
Current State
- ✅ VM provisioning via cloud-init
- ✅ Basic app setup (copy files,
.env config, docker compose up)
- ❌ SSL certificate generation
- ❌ Crontab setup for renewals
- ❌ Production hardening steps
Tasks
Implementation Notes
Deliverable: One-command deployment to production-ready state
Phase 4: Hetzner Infrastructure Implementation
Objective: Add Hetzner Cloud provider support and validate complete deployment
Tasks
Provider Firewall Consideration
- VM firewall via cloud-init: ✅ Required
- Provider firewall: 🤔 Optional additional security layer
Validation
Deliverable: Working Hetzner deployment with IP access
Phase 5: Database Migration (Optional)
Objective: Migrate existing tracker data from Digital Ocean SQLite to Hetzner MySQL
Tasks
Note: This step is optional and can be skipped for a fresh start
Phase 6: Grafana Configuration
Objective: Manually configure Grafana for monitoring the tracker.
Tasks
Note: An issue will be opened with more details when work on this phase begins.
Deliverable: A configured Grafana instance with a Prometheus data source and dashboards.
Phase 7: Testing and Validation
Objective: Comprehensive testing of the new Hetzner deployment
Testing Areas
Test Scenarios
Deliverable: Fully validated production deployment
Phase 8: Go Live
Objective: Switch production traffic to Hetzner infrastructure
Pre-Go-Live
Go-Live Steps
Post-Go-Live
Deliverable: Production traffic on Hetzner infrastructure
Future Considerations
Dynamic Configuration (Future Work)
Currently hardcoded in cloud-init:
- Number of tracker instances (e.g., 2 UDP trackers on ports 6868, 6969)
- Firewall port configurations
- Service scaling parameters
Future Enhancement: Inject dynamic configuration via template variables
Repository Template Usage
This repository serves as a template for users deploying their own trackers. Current
hardcoded configurations can be manually adapted, but future work could make this more
dynamic.
Risk Mitigation
Rollback Plan
- Keep Digital Ocean instance running until Hetzner deployment is fully validated
- Maintain DNS rollback capability
- Document emergency procedures
Testing Strategy
- All changes tested locally before Hetzner deployment
- Staged rollout with validation at each phase
- Comprehensive testing before DNS switch
Success Criteria
We decided to change hosting providers due to cost and performance.
Summary
This epic tracks the complete migration of the Torrust Tracker demo from its current environment to a new virtual machine hosted on Hetzner. The goals are:
Torrust Tracker Demo Migration Plan - Digital Ocean to Hetzner
UPDATED ON: 2025-08-07
Overview
This plan outlines the migration of the Torrust Tracker demo from Digital Ocean to Hetzner
infrastructure. The migration prioritizes ease of updates over performance by maintaining
Docker-based deployments, and follows a complete local development and testing approach
before deploying to production.
Key Decisions
(just pull new images)
any Hetzner VMs
practices
Migration Phases
Phase 1: Database Migration to MySQL
Objective: Replace SQLite with MySQL as the default database
Tasks
docker-compose.yamltracker.toml) to use MySQL connection.env.production)Validation
make applytorrentstableDeliverable: Working local deployment with MySQL backend
Phase 2: 12-Factor App Refactoring
Objective: Refactor repository to follow 12-Factor App methodology
Reference: See detailed plan in
infrastructure/docs/refactoring/twelve-factor-refactor/Key Changes
Tasks
Deliverable: 12-Factor compliant repository structure
Phase 3: Complete Application Installation Automation
Objective: Fully automate tracker deployment including SSL certificates
Current State
.envconfig,docker compose up)Tasks
Implementation Notes
Deliverable: One-command deployment to production-ready state
Phase 4: Hetzner Infrastructure Implementation
Objective: Add Hetzner Cloud provider support and validate complete deployment
Tasks
Provider Firewall Consideration
Validation
Deliverable: Working Hetzner deployment with IP access
Phase 5: Database Migration (Optional)
Objective: Migrate existing tracker data from Digital Ocean SQLite to Hetzner MySQL
Tasks
Note: This step is optional and can be skipped for a fresh start
Phase 6: Grafana Configuration
Objective: Manually configure Grafana for monitoring the tracker.
Tasks
http://localhost:3100/with default credentials (admin/admin).Note: An issue will be opened with more details when work on this phase begins.
Deliverable: A configured Grafana instance with a Prometheus data source and dashboards.
Phase 7: Testing and Validation
Objective: Comprehensive testing of the new Hetzner deployment
Testing Areas
Test Scenarios
Deliverable: Fully validated production deployment
Phase 8: Go Live
Objective: Switch production traffic to Hetzner infrastructure
Pre-Go-Live
Go-Live Steps
Post-Go-Live
Deliverable: Production traffic on Hetzner infrastructure
Future Considerations
Dynamic Configuration (Future Work)
Currently hardcoded in cloud-init:
Future Enhancement: Inject dynamic configuration via template variables
Repository Template Usage
This repository serves as a template for users deploying their own trackers. Current
hardcoded configurations can be manually adapted, but future work could make this more
dynamic.
Risk Mitigation
Rollback Plan
Testing Strategy
Success Criteria