A command-line tool for easily migrating Dokku applications and databases between servers.
- 🚀 Single-Command Installation: Get up and running with a single curl command
- 🔄 Complete Migration: Migrate entire Dokku environments or select specific apps
- 🧩 Modular Design: Run individual steps or the complete migration process
- ⚙️ Flexible Configuration: Configure via file or command-line arguments
- 🔒 Secure: Uses SSH keys for secure server access
- 📊 Comprehensive: Transfers apps, databases, config, domains, and volumes
- 🧠 Smart Defaults: Sensible defaults with the ability to override
curl -fsSL https://raw.githubusercontent.com/pedropaf/dokku-migration/main/install.sh | bash
This will:
- Install the tool in
~/.dokku-migration
- Create a symlink in
/usr/local/bin
- Create a default configuration file at
~/.dokku-migration-config
# Edit your configuration
nano ~/.dokku-migration-config
# Run a complete migration
dokku-migration run-all
# OR run individual steps
dokku-migration export
dokku-migration import-db
dokku-migration import-apps
dokku-migration cleanup
Edit the default configuration file:
nano ~/.dokku-migration-config
Or specify a custom configuration file:
dokku-migration --config /path/to/config.sh run-all
Or override configuration via command-line:
dokku-migration \
--source 192.168.1.10 \
--dest 192.168.1.20 \
--source-port 22 \
--dest-port 22 \
--apps "app1 app2" \
--dbs "db1 db2" \
--email "[email protected]" \
run-all
Command | Description |
---|---|
export |
Export apps and databases from source server |
import-db |
Import databases to destination server |
import-apps |
Import applications to destination server |
cleanup |
Clean up temporary files |
run-all |
Run complete migration (all steps) |
version |
Display version information |
--help |
Display help message |
- ✅ Application Docker images
- ✅ Environment variables
- ✅ Domain configurations
- ✅ Let's Encrypt certificates
- ✅ Database content
- ✅ Persistent storage (volumes)
- ✅ Process scaling configuration
- SSH access to both source and destination servers
- Dokku installed on both servers
- Proper SSH key configuration
Option | Description | Default |
---|---|---|
SOURCE_SERVER_IP |
Source server IP address | - |
DEST_SERVER_IP |
Destination server IP address | - |
SOURCE_SERVER_PORT |
Source server SSH port | 22 |
DEST_SERVER_PORT |
Destination server SSH port | 22 |
SOURCE_SERVER_KEY |
Source server SSH key file | ~/.ssh/id_rsa |
DEST_SERVER_KEY |
Destination server SSH key file | ~/.ssh/id_rsa |
APPS |
Array of applications to migrate | - |
DBS |
Array of databases to migrate | - |
LETSENCRYPT_EMAIL |
Email for Let's Encrypt certificates | - |
dokku-migration --apps "app1 app2" --dbs "db1 db2" run-all
dokku-migration \
--source remote-server-1.example.com \
--dest remote-server-2.example.com \
--source-key ~/.ssh/server1_key \
--dest-key ~/.ssh/server2_key \
run-all
dokku-migration export
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Dokku for making deployment awesome
- All contributors who have helped shape this tool
Made with ❤️ by Pedro Alonso