I’m migrating from sqlite to postgres. Use the built in tools to export and import the entities seem to work. But SSO is not enabled when using postgres. I have the license file as a system environment variable.
This is running on windows server using node.js
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- n8n version: 2.6.4
- Database (default: SQLite): sqlite to postgres
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): npm
- Operating system: windows server
I was able to figure out a local password and log in. the license was activated. but the Federation metadata URL was missing for SSO and SSO was not enabled. Adding those two items allowed me to use SSO. Then I noticed that none of the workflows or credentials came over 
Hi @jbenway!
Can you ensure that your N8N_ENCRYPTION_KEY is the same on both systems? Otherwise, the credentials will not be recognized.
Its on the same server, I installed Postgres on the existing server. I copied the key from .n8n to an environmental variable
@jbenway
Even if it’s the same server, it’s still possible that n8n is now pointing to a fresh Postgres database that doesn’t contain the data from the SQLite instance yet. What I would check is whether n8n is actually connected to Postgres by confirming the environment variables like DB_TYPE=postgresdb, DB_POSTGRESDB_DATABASE, and DB_POSTGRESDB_HOST. I recomend verify that the data was actually imported into Postgres, one way to do that is by connecting to the database and checking if tables like workflow_entity and credentials_entity contain any records and make sure the N8N_ENCRYPTION_KEY is exactly the same value that was in the .n8n/config file before the migration, making sure there are no extra spaces or line breaks.
After aall that.. , I would restart n8n so it loads the key correctly.
I confirmed the environment variables are set, I check postgres tables and see the users, workflows, etc in the DB and I confirmed the key in the varaiable is the same as what is in .n8n/config. I restarted the server. 
@jbenway
Run this in Postgres: SELECT COUNT() FROM workflow_entity; and SELECT COUNT() FROM shared_workflow If the numbers are different, it means the workflows exist in the database but aren’t shared with any user or project. Also check if there might be any schema issues by running SELECT * FROM migrations ORDER BY timestamp DESC
If none of that reveals anything, then I might have to apologize because at that point I’m not really sure what could be going on haha. 
SELECT * FROM migrations ORDER BY timestamp DESC returned 139 rows,
workflow entity has 20 rows, shared workflows has 0 rows.
Sounds like the workflows are shared with any users or projects. this is a test server, most of the 20 should be my personal works with only about 4 or 5 in projects.
Thank you for your time and help
Jason
1 Like
I’m really happy to hear this helped
@jbenway
If this solution solved the issue for you, please consider leaving a like or marking the reply as the solution ( it helps others find the answer more easily and also supports community contributors.)
Do I copy the workflow entity table to the shared workflow table?
I noticed the shared credential table is empty too
@jbenway
In n8n, workflows need a record in shared_workflow to define ownership, otherwise they won’t appear in the UI even though they still exist in the database. Since this is a test server and you know most of those workflows belong to you, the fix is usually to recreate the sharing entries. You can check your user ID in user or project tables and insert the corresponding records into shared_workflow linking the workflow IDs to your user/project. Once those relations exist again, the workflows should become visible in the editor (I hope!)