Hello everyone,
I’m seeking advice on the safest way to update my n8n instance and understand a persistent data issue I’m facing.
I’m currently running an older version of n8n on an AWS EC2 instance. Every attempt to update to a newer version fails: the container starts up and sends me to the initial setup screen, as if all my data has been lost. I’ve been able to recover by restoring an AWS snapshot, but I need a sustainable update path.
Key Diagnostics & Findings:
After extensive troubleshooting, we’ve discovered a very unusual situation:
-
Bind Mount is Being Ignored: My original
docker runcommand specifies a bind mount (-v ~/.n8n:/root/.n8n). However, the n8n container is completely ignoring this path. The data in/home/ec2-user/.n8nis an old, empty database. -
Actual Data Location: The live, in-use database is actually being written to the container’s internal overlay filesystem. On the host, the path is:
/var/lib/docker/overlay2/[long-hash-string]/diff/home/node/.n8n/database.sqlite. -
Data is Verified: I have confirmed that the database at this
overlay2path is large (~542 MB) and contains all of my workflows (88 total, verified withsqlite3). The associatedconfigfile in this directory also contains the correctencryptionKey. -
The Update Still Fails: Despite having a verified backup of this correct data, every attempt to restore it for the new version fails. My process has been:
- Create a new Docker Managed Volume (
docker volume create n8n_data). - Restore the verified backup files (
database.sqlite,config, etc.) into this volume. - Correct the permissions inside the volume so all files are owned by the
nodeuser (chown -R 1000:1000). - Launch the new n8n container, pointing to this correctly populated and permissioned volume (
-v n8n_data:/root/.n8n).
- Create a new Docker Managed Volume (
Even with all this, the new container fails to start correctly and reports that the encryption key was not found.
My Questions for the Community:
- Why would a Docker container completely ignore a specified bind mount and default to its internal storage? Is this a known behavior in certain n8n versions or on specific environments like Amazon Linux?
- Is there a known issue with security modules (like SELinux on Amazon Linux) that would prevent a container from reading a file from a Docker Managed Volume, even when the user/group permissions (UID/GID) are correctly set?
- Given this persistent and strange behavior, what is the most robust strategy to migrate this data and successfully update? Would switching to Docker Compose fundamentally solve this, and if so, what is the recommended way to handle this initial data migration?
Any insights or suggestions would be greatly appreciated. Thanks!
What is the error message (if any)?
When attempting to start the updated container with the restored data, the logs consistently show this error, which leads to a fresh setup screen:
No encryption key found - Auto-generating and saving to: /home/node/.n8n/config
Please share your workflow
Not applicable. This issue is related to the deployment environment, not a specific workflow.
Share the output returned by the last node
Not applicable.
Information on your n8n setup
-
n8n version:
- Current (working): An older version (e.g.,
1.98.1). - Target (failing):
1.104.1
- Current (working): An older version (e.g.,
-
Database (default: SQLite): SQLite
-
n8n EXECUTIONS_PROCESS setting (default: own, main):
default (own) -
Running n8n via (Docker, npm, n8n cloud, desktop app): Docker. I am not using Docker Compose, only the following
docker runcommand:# Note: The specific version/tag was omitted in the original command. sudo docker run -d --restart unless-stopped -it --name n8n \ -p 5678:5678 \ -e N8N_HOST="subdomain.your-domain.com" \ -e WEBHOOK_TUNNEL_URL="[https://subdomain.your-domain.com/](https://subdomain.your-domain.com/)" \ -e WEBHOOK_URL="[https://subdomain.your-domain.com/](https://subdomain.your-domain.com/)" \ -v ~/.n8n:/root/.n8n \ n8nio/n8n -
Operating system: Amazon Linux on an AWS EC2 t3.medium instance.