Complete Migration of N8N Application to a New Environment: Technical Issue

Describe the problem/error/question

Hello, good morning!

I am currently running my N8N on an EC2 instance, pointing to a database hosted on the AWS RDS service. However, due to the high costs of RDS, I am migrating my data from this database to a new, lower-cost database. Additionally, I’ve started using N8N as a docker-compose service, rather than starting it directly via Docker.

However, after completing the data migration and logging into the application, it appears that my credentials for accessing external services no longer work. They are still displayed in the list, but they don’t function.

To put it plainly, how can I fully migrate my N8N application to a new environment without losing anything at all?

Information on your n8n setup

  • n8n version: latest
  • Database (default: SQLite): postgresql
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Amazon Linux

Welcome to the community @GuilhermeTrivilin!

It is important that the used encryption key is the same. If they are not identical than n8n will not be able to decrypt them. Did you make sure they are identical?

We did a test after migrating and it appears that the encryption keys are not the same. How do we migrate while ensuring that the encryption remain the same?

By setting it to be the same.

So either:

  • copy over the file ~/.n8n/config from the orignal instance to the new one


  • setting the environment variable N8N_ENCRYPTION_KEY on the new instance to the same value the encryptionKey was set in the file ~/.n8n/config

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.