thanks it’s working
This command not working (on windows)
n8n import:credentials --separate --input=backups/latest/
Any errors? How did you export the credentials as well?
yes but I already moved on so you can test it,
I have another problem I import credentials from the cli, and I see in the SQLite that all the records are inserted, but in the nathan UI when I open credentials one is missing
when I import I get the message the 5 records imported, but I can see only 4
@Asaf_Shay could you describe the steps to reproduce this from scratch? E.g. which operating system and shell do I need, how I need to set up my n8n instance (and which version is being used), which credentials do I need to import exactly from which files?
I use windows 10 open cmd, I clone the latest n8n from git (Version: 0.151.0)
I export all credentials with this command
n8n export:credentials --all --output=cred/allcred.json
and I import with this command
n8n import:credentials --input=cred/allcred.json
I can’t share the cred.json because obviously, I have sensitive info.
Which credentials type is it? Are you importing credentials on the same n8n version you’re exporting them from? Previously, one of your problems appears to have been caused by the n8n command not always executing the binary you were expecting it to execute.
So I am wondering if the credentials might just have gotten imported to a different n8n instance.
yes it’s on different instance
So how would each instance be set up? Both Windows 10, both n8n 0.151.0? How is n8n installed in each case and which credentials type is the problematic one?
I install it on windows server 2019 (on aws) it’s the same version number,
I zip the current n8n project and when I bring up new instance on amazon I download the zip I made and unzip and install and import all workflows and credentials
I made a tutorial that I need set up FriendGrid account credentials (I don’t remember if this tutorial is from your site or just from youtube), this credentials I can’t see in the UI
it was from your site
So FriendGrid is the name of a custom node that appears in this tutorial:
It’s not a real service or part of n8n and I suspect you have not moved over your custom node and credentials to your new service which is why the target instance can’t do anything with it.
ok I get it, I clone new version from git without the custom component that I made, because of that I can’t see it as you said
thanks a lot
now I have the problem that when I try to run workflow that have credentials of amazon, I get the message
" Error: Credentials could not be decrypted. The likely reason is that a different “encryptionKey” was used to encrypt the data."
I look at here
it’s not help me because I don’t want to recreate the credentials just to import them
That would be because your instances use different encryption keys. You can configure it in your ~/.n8n/config file (or by setting the environment variable before the first launch as suggested by @jan in the thread you have linked).
However, seeing that you have only 4 sets of credentials (when excluding the FriendGrid ones), you can always just delete the non-working ones and re-create them manually.
I try the environment variable and didn’t work for me.
I don’t want to use it manually for any action,
the purpose is that a new computer comes up(ec2 instance) he installs the n8n import all that we talk and run a specific workflow that I tell him, all happen automatically from a batch file,
what happens if a couple of people on different computers will create credentials for their workflow, when I import them I will have a problem?
I’m not sure how n8n behaves if there is a conflict between the config file and the variable:
So if the new instance has already been started for the first time, you want to try updating the config file in the .n8n folder inside your home directory (and restart the instance). For brand new deployments you can use the environment variable.
it’s not working (on windows) the set environment variable
@jan said that I need to recreate the credentials, is it true ? because if so I have a problem because I import the credentials , unless I can recreate them from json
So I gave this a go on my end, but this is working as expected.
Using Powershell on Windows I first set the variable using $env:N8N_ENCRYPTION_KEY = "abcdef123456foobar" (and then print it, to be 100% sure it worked). I then launch n8n from my repository directory using .\packages\cli\bin\n8n.cmd
The output confirms a fresh config file was generated. This file includes the key I have set through the variable:
So in order to help you with this I’d really need a more detailed description of how to reproduce your problem.
As an alternative if you can’t update the encryption key in the .n8n folder would be to use
n8n export:credentials --all --decrypted --output=backups/decrypted.json
This will export the credentials in plain text so make sure you keep them safe.


