How to migrate n8n workflows between Hostinger VPS instances

Transfer your n8n workflows, credentials, and settings across Hostinger VPS environments.

Updated 2 weeks ago

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 --version on 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 pg_dump backup and restore alongside file transfers.

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 shows DB_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_KEY value.
  • 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_KEY on 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.

  1. Log in to hPanel and navigate to VPSDocker Manager.
  2. Locate the source n8n project, click Manage, and select Stop.
  3. 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.gz

Step 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

  1. In hPanel, navigate to VPSDocker Manager for your destination project.
  2. Click Manage and select Start.
  3. Once online, click Open to access the n8n interface.
  4. Log in using your original source credentials.
  5. 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.json

Step 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.json

Option 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.json

NOTE

  • 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.json

Transfer credentials – run the command matching your export option.

For Option A (encrypted):

scp /root/credentials.json root@185.185.185.185:/root/credentials.json

For Option B (decrypted):

scp /root/credentials-decrypted.json root@185.185.185.185:/root/credentials-decrypted.json

Step 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.json

Copy credentials – run the command matching your export option.

For Option A (encrypted):

docker cp /root/credentials.json <destination-container-name>:/home/node/credentials.json

For Option B (decrypted):

docker cp /root/credentials-decrypted.json <destination-container-name>:/home/node/credentials-decrypted.json

Step 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.json

For Option B (decrypted):

docker exec -u node -it <destination-container-name> n8n import:credentials --input=/home/node/credentials-decrypted.json

Then import workflows:

docker exec -u node -it <destination-container-name> n8n import:workflow --input=/home/node/workflows.json

Map 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 VPSDocker ManagerManageEnvironment variables.

To test each workflow:

  1. Open the destination n8n UI via hPanel ❯ VPSDocker Managern8n container ❯  Open.
  2. Open an imported workflow and inspect all nodes for credential warnings or missing assignments.
  3. Click Execute workflow to trigger a manual test run.
  4. 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.
  5. Re-run the workflow and confirm the execution log shows a success state for all nodes.
  6. 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:

  1. Navigate to VPSDocker Manager on your destination VPS.
  2. Open n8n UI and on each active workflow, set the toggle to Inactive.
  3. In hPanel, go to your source VPSDocker Manager.
  4. Open your original n8n project, click , and select Start.
  5. Confirm the source instance is accessible by clicking Open and logging in.
  6. Update any third-party services or webhook endpoints to point back to your original domain or IP address.

To decommission after a successful migration:

  1. Stop the source n8n container via hPanel ❯ VPSDocker Managerclick ⋮Stop.
  2. Delete the temporary backup files from both VPS machines based on your chosen migration method.
  3. 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.

Additional resources