Unable to run workflow after migrating from SQLite to Postgres

I am self hosting N8N in docker and it defaults to using SQLite. After playing a bit, I thought it would be time to upgrade so i added the postgres service to my compose file and do the CLI command to export the entities, workflow, and credentials CLI Commands.

If I understand correctly, I should be able to use just the entities as it contains all the data inside my n8n. So after exporting the entities, I remove my container, reconfigured the compose, starts the container, and run the n8n import:entities --inputDir ./outputs --truncateTables true

Then I had my first error which is duplicate key value violates unique constraint “pk_workflows_tags”. After researching a bit I found out that the entities.zip contains “workflows_tags.jsonl” and “workflowtagmapping.jsonl”. I removed the “workflowtagmapping.jsonl” from the zip file and run the import command again.

It succeeds and I can see all my workflows, credentials, execution, users, etc. However, I am not able to run a single workflow manually. Whenever I tried, I got the error “Problem running workflow : There is already an entry with this name”.

Why is this happening and how to fix it?

Hey, looks like your post got cut off mid-sentence! Can you repost the full thing along with any error messages youre seeing?

Copying it below :

I am self hosting N8N in docker and it defaults to using SQLite. After playing a bit, I thought it would be time to upgrade so i added the postgres service to my compose file and do the CLI command to export the entities, workflow, and credentials CLI Commands.

If I understand correctly, I should be able to use just the entities as it contains all the data inside my n8n. So after exporting the entities, I remove my container, reconfigured the compose, starts the container, and run the n8n import:entities --inputDir ./outputs --truncateTables true

Then I had my first error which is duplicate key value violates unique constraint “pk_workflows_tags”. After researching a bit I found out that the entities.zip contains “workflows_tags.jsonl” and “workflowtagmapping.jsonl”. I removed the “workflowtagmapping.jsonl” from the zip file and run the import command again.

It succeeds and I can see all my workflows, credentials, execution, users, etc. However, I am not able to run a single workflow manually. Whenever I tried, I got the error “Problem running workflow : There is already an entry with this name”.

Why is this happening and how to fix it?

Hi Benjamin,

Just get back on it and i noticed all the issues are gone. I didn’t do a single thing after posting this thread. I’ve checked most of the features such as running workflow manually, creating credentials, checking execution data, etc and it seems to be working normally now.

Not sure if this is solved due to the container restarting as i’m hosting it on my laptop which means it will turned down when i shutdown my laptop. Truly grateful for your help and suggestions, thanks