Migrating from SQLite to Postgres

Describe the problem/error/question

We are trying to migrate to postgres from SQLite and are running into concerns with license backup and restore, SSO integration, and environments settings. What is the best way to migrate to keep license and other settings intact?

All workflows and credentials are backed up currently.

Information on your n8n setup

  • n8n version: 1.16.0
  • Database (default: SQLite): SQLite currently
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: Ubuntu 22.04.1

I also tried to take the cert data from the sqlite db and insert that into the new postgres database it gave an error:

| error    | [license] cert could not be initialized. Invalid Data: Could not decrypt data with key found "{ file: 'LicenseManager.js', function: 'log' }"

Hi @Perps01, I am sorry you are having trouble.

Could not decrypt data with key found

This seems to be the cause of the problem you are seeing. The key would live in the config file inside of /home/node/.n8n in your n8n docker container.

Is it possible that your n8n instance using SQLite is simply using a different volume than your new n8n instance using PostgreSQL?

In case you have also upgraded to v1 as a part of this you might also need to make sure you update the file system permissions as per this section our migration guide.

@MutedJam Thanks for the reply I actually had this fixed, I reached out to N8N sales with the situation and they allowed an additional activation of our license key. We are now fully migrated to Postgres. Although to answer your question the volumes weren’t changed between being on SQLite and Postgres.

1 Like