Hi everyone,
I’m trying to migrate my self-hosted n8n instance from an old VPS to a new one. My goal is to have all workflows, credentials, and settings exactly as they were on the old server.
What I’ve Done So Far:
- I’m using Docker Compose on both servers.
- On the old server, my
docker-compose.ymluses a Docker-managed volume:
volumes:
- n8n_data:/home/node/.n8n
- I created a backup of the Docker volume using:
docker run --rm -v n8n_data:/volume -v $(pwd):/backup alpine sh -c "cd /volume && tar -czvf /backup/n8n_data.tar.gz ."
- Then I copied
n8n_data.tar.gzto the new server. - On the new server:
- I created the volume:
docker volume create n8n_data
- Restored the backup:
docker run --rm -v n8n_data:/volume -v /root:/backup alpine sh -c "cd /volume && tar -xzvf /backup/n8n_data.tar.gz"
- My
docker-compose.ymlon the new server is the same:
services:
n8n:
image: n8nio/n8n:latest
container_name: n8n_compose_instance
restart: unless-stopped
ports:
- "5678:5678"
environment:
- WEBHOOK_URL=http://<new-server-ip>:5678/
- N8N_HOST=<new-server-ip>
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:
- I ran:
docker-compose down
docker-compose up -d
The Problem:
Even though n8n runs fine on the new server, it’s starting from a fresh instance — all workflows and credentials are missing.
What I Need Help With:
- Am I missing something in copying the Docker volume?
- Is there a better way to ensure I bring over all n8n data (especially workflows & credentials)?
- Would switching to a bind mount (
/root/n8n_data:/home/node/.n8n) be more transparent?
Would really appreciate your help in figuring this out.
Thanks in advance!
