I’m trying to transfer my workflows and credentials between dev / prod environments through n8n CLI.
Everything is imported succcesfully and all IDs remained the same.
In the new env I added new credentials for my dev DB, so i did not bother to take encryption into account. I just wanted to make sure the nodes which had credentials connected to them would use the same credentials.
The credentials work in the new environment when creating new workflows, however they do not with existing/imported workflows.
Credential with ID "MZEjYCHIu1AeVeNT" does not exist for type "supabaseApi".
Getting this output when running the imported nodes.
That’s because the credentials has the unique IDs (just like the workflows do). And when you are importing it to another environment, n8n can’t map them automatically. So you will need a script that will replace the credential id in an exported workflow with the one that has the same name, but the different ID in the prod.
@barn4k I exported both the workflows and the credentials with n8n CLI by ID query from my prod environment, I checked and all IDs in the json files remain the same as they are in the UI.
Then i imported in my dev environment with CLI, and the IDs remain the same again. After importing I also exported the new credentials and workflows from my dev environment, checked the new json files and also there the IDs seem to have remained the same. (the credential IDs in the specific nodes that are connected to the credential)
Are there other things that play into account here?
Because i imported the same credentials i exported from my prod environment, the ID actually remained the same.
I verified this by exporting the newly imported keys from my dev environment after importing them.
I also verified whether the node was connected to the correct credentials, which seems to be the case as also in there the IDs remained the same after importing.
Could it have something to do with the nodesAccess key which does not seem to get imported with the credentials?