This article explains how to migrate your n8n workflows, credentials, and system settings to a new instance running on a Hostinger VPS. Moving your n8n setup securely ensures that your workflow data, database configurations, and environment variables remain intact. You can perform this migration using a full data volume transfer or a command-line interface (CLI) export.
Before you start
Before migrating, verify your system configuration, database types, and version compatibility between your source and destination instances.
Check n8n version compatibility
The destination n8n version must be equal to or newer than the source version. Do not import workflows from a newer n8n version into an older one, as workflow data structures, credential schemas, and node behaviors are not backward compatible.
|
Source version |
Destination version |
Compatible |
|
1.x |
1.x (same or higher) |
Yes |
|
1.x |
0.x (older) |
No |
|
0.x |
1.x |
Yes |
NOTE
- To check your n8n version, run
docker exec -u node -it <container-name> n8n --versionon your source VPS terminal.
Check database and storage
n8n stores workflows, user accounts, and execution data in a connected database. Custom configurations and binary data reside in the local file system directory (/home/node/.n8n inside the container).
|
Database type |
Storage location |
Migration approach |
|
SQLite (default) |
n8n data directory |
Fully covered by volume copy in Method 1. |
|
PostgreSQL |
External or separate container |
Requires independent |
NOTE
- To check if your source instance uses PostgreSQL, run
docker inspect <container-name> | grep -E "DB_TYPE|DB_POSTGRESDB"on your source VPS terminal. If the output showsDB_TYPE=postgresdb, back up and restore the PostgreSQL database independently.
Handle the encryption key
n8n secures stored credentials using an encryption string set via the N8N_ENCRYPTION_KEY environment variable. This key is generated automatically on first launch unless defined manually.
NOTE
- An encrypted credential import only succeeds if the destination instance uses the exact same
N8N_ENCRYPTION_KEYvalue. - If your destination instance uses a different encryption key, use the decrypted export path in Method 2.
- To check if an explicit encryption key is set on your source instance, run
docker inspect <container-name> | grep N8N_ENCRYPTION_KEYon your source VPS terminal.
Method 1 – Transfer the full data volume
Use this method when both the source and destination n8n instances are deployed on a Hostinger VPS using the standard Hostinger Docker catalog layout. This method copies the persistent Docker volume, preserving your workflows, user accounts, execution history, and credential configurations.
Step 1 – Stop both n8n containers
To prevent data corruption or incomplete file copying, stop both the source and destination n8n containers.
- Log in to hPanel and navigate to VPS ❯ Docker Manager.
- Locate the source n8n project, click Manage, and select Stop.
- Repeat for the destination n8n project.
Step 2 – Create a backup archive on the source VPS
Connect to your source VPS via SSH. Create a compressed archive of the persistent n8n volume data directory. Replace n8n-XXXX_n8n_data with your actual source volume name:
tar -czf /root/n8n-backup.tar.gz -C /var/lib/docker/volumes/n8n-XXXX_n8n_data/_data .Step 3 – Transfer the archive to the destination VPS
From your source VPS terminal, securely copy the archive to the destination server. Replace 185.185.185.185 with your destination Hostinger VPS IP address:
scp /root/n8n-backup.tar.gz root@185.185.185.185:/root/n8n-backup.tar.gzStep 4 – Restore the archive on the destination VPS
Connect to your destination VPS via SSH. Clear the destination volume path completely before unpacking the archive to avoid leftover configuration conflicts. Replace n8n-YYYY_n8n_data with your destination volume name:
find /var/lib/docker/volumes/n8n-YYYY_n8n_data/_data/ -mindepth 1 -delete
tar -xzf /root/n8n-backup.tar.gz -C /var/lib/docker/volumes/n8n-YYYY_n8n_data/_data/Step 5 – Start the destination container and verify
- In hPanel, navigate to VPS ❯ Docker Manager for your destination project.
- Click Manage and select Start.
- Once online, click Open to access the n8n interface.
- Log in using your original source credentials.
- Review your workflows and credentials to confirm everything transferred correctly.
NOTES
- Keep the source container stopped until you have thoroughly tested the destination instance.
- Delete the temporary backup file after a successful migration by running
rm /root/n8n-backup.tar.gz.
Method 2 – Migrate workflows and credentials via CLI
Use this method when migrating from alternative self-managed deployments or separate hosting providers where direct volume sharing is not possible.
Step 1 – Export workflows from the source instance
Connect to your source server via SSH. Replace <source-container-name> with your active source container name:
docker exec -u node -it <source-container-name> n8n export:workflow --all --output=/home/node/workflows.json
docker cp <source-container-name>:/home/node/workflows.json /root/workflows.jsonStep 2 – Export credentials from the source instance
Select the option that matches your destination environment.
Option A – Export encrypted credentials
Use this option if your destination instance uses the same N8N_ENCRYPTION_KEY value:
docker exec -u node -it <source-container-name> n8n export:credentials --all --output=/home/node/credentials.json
docker cp <source-container-name>:/home/node/credentials.json /root/credentials.jsonOption B – Export decrypted credentials
Use this option if your destination instance uses a different encryption key:
docker exec -u node -it <source-container-name> n8n export:credentials --all --decrypted --output=/home/node/credentials-decrypted.json
docker cp <source-container-name>:/home/node/credentials-decrypted.json /root/credentials-decrypted.jsonNOTE
- Decrypted export files contain plaintext secrets. Treat this data securely, avoid sending it over open networks, and delete it immediately after use.
Step 3 – Transfer files to the destination VPS
Replace 185.185.185.185 with your destination Hostinger VPS IP address.
Transfer workflows:
scp /root/workflows.json root@185.185.185.185:/root/workflows.jsonTransfer credentials – run the command matching your export option.
For Option A (encrypted):
scp /root/credentials.json root@185.185.185.185:/root/credentials.jsonFor Option B (decrypted):
scp /root/credentials-decrypted.json root@185.185.185.185:/root/credentials-decrypted.jsonStep 4 – Copy export files into the destination container
Connect to your destination VPS via SSH. Replace <destination-container-name> with your target container name.
Copy workflows:
docker cp /root/workflows.json <destination-container-name>:/home/node/workflows.jsonCopy credentials – run the command matching your export option.
For Option A (encrypted):
docker cp /root/credentials.json <destination-container-name>:/home/node/credentials.jsonFor Option B (decrypted):
docker cp /root/credentials-decrypted.json <destination-container-name>:/home/node/credentials-decrypted.jsonStep 5 – Import credentials and workflows
Import credentials first so that incoming workflows can map to existing credential IDs automatically.
For Option A (encrypted):
docker exec -u node -it <destination-container-name> n8n import:credentials --input=/home/node/credentials.jsonFor Option B (decrypted):
docker exec -u node -it <destination-container-name> n8n import:credentials --input=/home/node/credentials-decrypted.jsonThen import workflows:
docker exec -u node -it <destination-container-name> n8n import:workflow --input=/home/node/workflows.jsonMap environment variables and test workflows
After completing Method 2, map any system-level environment variables used by your workflows to your destination VPS. Add them via VPS ❯ Docker Manager ❯ Manage ❯ Environment variables.
To test each workflow:
- Open the destination n8n UI via hPanel ❯ VPS ❯ Docker Manager ❯ n8n container ❯ Open.
- Open an imported workflow and inspect all nodes for credential warnings or missing assignments.
- Click Execute workflow to trigger a manual test run.
- Check the execution output of each node for errors. Common post-import failures include Credential not found and Webhook URL mismatch. Re-enter credentials or update webhook target URLs in connected third-party services as needed.
- Re-run the workflow and confirm the execution log shows a success state for all nodes.
- Set the workflow toggle to Active only after a clean manual test run.
NOTE
- Do not activate workflows in bulk. Enable them one at a time and monitor the execution log for each.
Decommission the source or roll back
Leave your source VPS intact for at least 24 to 48 hours after completing the migration.
To roll back if you encounter unexpected issues:
- Navigate to VPS ❯ Docker Manager on your destination VPS.
- Open n8n UI and on each active workflow, set the toggle to Inactive.
- In hPanel, go to your source VPS ❯ Docker Manager.
- Open your original n8n project, click ⋮ , and select Start.
- Confirm the source instance is accessible by clicking Open and logging in.
- Update any third-party services or webhook endpoints to point back to your original domain or IP address.
To decommission after a successful migration:
- Stop the source n8n container via hPanel ❯ VPS ❯ Docker Manager ❯ click ⋮ ❯ Stop.
- Delete the temporary backup files from both VPS machines based on your chosen migration method.
- Remove the source n8n Docker project from Docker Manager once you confirm the migration is complete.
Your n8n workflows and configurations are now fully operational on your new Hostinger VPS.