# Credentials "transfer" using dumped SQL table

**URL:** <https://community.n8n.io/t/credentials-transfer-using-dumped-sql-table/125766>\
**Category:** Questions\
**Tags:** credential-sharing\
**Created:** [June 2, 2025, 11:42pm UTC](https://community.n8n.io/t/credentials-transfer-using-dumped-sql-table/125766 "2025-06-02T23:42:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunolnetto](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/brunolnetto/32/43672_2.png) [@brunolnetto](https://community.n8n.io/u/brunolnetto)\
**Post date:** [June 2, 2025, 11:42pm UTC](https://community.n8n.io/t/credentials-transfer-using-dumped-sql-table/125766/1 "2025-06-02T23:42:50Z")

</div>

## Describe the problem/error/question

I exported the credentials table from a self-hosted n8n with intention of restoring it on another instance. The credentials appeared on the second. However, they show up as “Waiting first use” or something like that. Since the credentials are stored in base64, I suppose there is no easy way to recover due its salt.

## What is the error message (if any)?

_Credential with ID “efCtVfO9hmh95bYS” could not be found._

How can I transfer credentials from one instance to another in a self-hosted environment without duplicating the whole database?

## Information on your n8n setup

- **n8n version: 1.95.4**
- **Database: Postgres**
- **n8n EXECUTIONS\_PROCESS setting: main**
- **Running n8n via: Docker**
- **Operating system: Ubuntu 20.04**

---

<div class="post-metadata">

**Author:** ![Erick\_Torres](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/erick_torres/32/66408_2.png) [@Erick\_Torres](https://community.n8n.io/u/Erick_Torres)\
**Post date:** [June 3, 2025, 2:48pm UTC](https://community.n8n.io/t/credentials-transfer-using-dumped-sql-table/125766/2 "2025-06-03T14:48:10Z")

</div>

n8n encrypts credentials using a private key generated per instance upon initial startup. This key is used to decrypt Base64 data (although the contents are visible, it’s useless without the key).

By default, this key is saved in a file in the container called:  
/home/node/.n8n/config

Or if you define your own persistence volume, it might look like this:  
/home/node/.n8n/encryption.key

Why can’t the credentials be read after the migration?  
Because the encryption key (encryptionKey) is different on the second instance.  
So, even if the logs are present, n8n can’t decrypt them.

Exporting and Importing Credentials in n8n  
Exporting Credentials: You can export all credentials in plain text using the following command:  
n8n export:credentials --all --decrypted --output=credentials.json

Importing Credentials: To import the exported credentials into a new n8n instance, use:  
n8n import:credentials --input=credentials.json

Make sure the new instance has the N8N\_ENCRYPTION\_KEY environment variable set correctly if you are using a custom key.

Please note that when exporting credentials in plain text, all sensitive information will be visible in the file. Therefore, handle this file with caution and delete it once the migration is complete.

If you need more details or additional assistance, please don’t hesitate to ask.

---

<div class="post-metadata">

**Author:** ![brunohlnp](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/brunohlnp/32/61849_2.png) [@brunohlnp](https://community.n8n.io/u/brunohlnp)\
**Post date:** [June 3, 2025, 3:01pm UTC](https://community.n8n.io/t/credentials-transfer-using-dumped-sql-table/125766/3 "2025-06-03T15:01:31Z")

</div>

I performed exactly what you mentioned, it worked like a charm. For workflows, I ssh tunneled the files to the new instance server, then copied inside the editor container and imported with a command. Thanks for the assistance!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/36532_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [September 1, 2025, 3:01pm UTC](https://community.n8n.io/t/credentials-transfer-using-dumped-sql-table/125766/4 "2025-09-01T15:01:48Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
