If your n8n backup workflow stops at Read/Write Files from Disk with Access to the file is not allowed., the target file path is the problem. Under n8n's default file security policy (filesystem access restrictions), the file nodes only write inside /home/node/.n8n-files when N8N_RESTRICT_FILE_ACCESS_TO is unset, and in a fresh Docker container that folder does not exist yet. Point the write node at /home/node/.n8n-files/, create the folder with mkdir -p, and the backup runs cleanly. On n8nio/n8n:1.76.1 our workflow wrote all 3 workflows on the instance to a single 4,711-byte JSON archive, the exact same byte size across all 3 measured runs.
Testing a full disaster-recovery restore into a fresh container exposed two additional traps that break automated backups in production. First, importing the raw JSON returned by the n8n API aborted with SQLITE_CONSTRAINT: FOREIGN KEY constraint failed after 3.1 seconds until two version-history fields (activeVersion and activeVersionId) were stripped. Second, credentials imported via n8n import:credentials into a container with a different encryption key printed Successfully imported 2 credentials. without complaint, then failed at runtime with Credentials could not be decrypted. when a workflow actually tried to use them.
Test setup
| Component | Tested Lab Setup & Parameters |
|---|---|
| n8n | n8nio/n8n:1.76.1 Docker image, SQLite default, containers A (gfl-n8n-up-a, source), B (gfl-n8n-up-b, restore with same key) and C (gfl-n8n-up-c, restore with different key) |
| Host | Docker Engine 27.5.1 (Official Docker Desktop), every container port bound strictly to 127.0.0.1 |
| Test data | Two small test workflows plus the backup workflow itself (3 workflows in total), and one fake Header Auth credential (gfl fake header auth). No real accounts or production secrets. |
| Repeats | File sizes, workflow execution durations, and CLI restore times below are measured across 3 runs each (2025-02-18). |


/home/node/.n8n-files satisfies n8n's default file-access restriction while pairing n8n export:workflow JSON archives with a separately vaulted N8N_ENCRYPTION_KEY guarantees zero-loss recovery on a fresh host."Access to the file is not allowed.": check the sandbox path and create the folder
When you configure Read/Write Files from Disk inside the official Docker image, the file name expression must start with /home/node/.n8n-files/ unless you explicitly override N8N_RESTRICT_FILE_ACCESS_TO. Before running the workflow, verify both the environment variable and whether the target directory exists inside your source container:
docker exec "$OLD" sh -c 'echo "N8N_RESTRICT_FILE_ACCESS_TO=${N8N_RESTRICT_FILE_ACCESS_TO:-unset}"; ls -ld /home/node/.n8n-files'
On a fresh n8nio/n8n:1.76.1 container, that check printed:
N8N_RESTRICT_FILE_ACCESS_TO=unset
ls: /home/node/.n8n-files: No such file or directory
When the variable prints unset, n8n enforces its default sandbox directory of ~/.n8n-files, which resolves to /home/node/.n8n-files for the node container user. In the terminal capture above, our audit script queried the execution list from the n8n REST API across three test runs: Execution 1 attempted to write to /home/node/backup-20250218.json outside the sandbox and failed with Access to the file is not allowed.; Execution 2 targeted /home/node/.n8n-files/ before the folder existed and failed with The file or directory does not exist; Execution 8 ran after mkdir -p /home/node/.n8n-files and wrote the 4,711-byte archive cleanly.

The 5-node backup workflow: a Webhook trigger and four processing nodes
To make each test run repeatable from a shell script, the workflow starts with a Webhook (POST) trigger at /webhook/gfl-backup. If you keep a Webhook trigger in production, enable header authentication or verify signed payloads using raw-body HMAC SHA256 verification in n8n; for unattended nightly snapshots, swap the Webhook node for a Schedule Trigger. After the trigger come four processing nodes in sequence:
- Get many workflows: the built-in
n8nnode configured withresource: workflow,operation: getAll, andreturnAll: trueso it fetches every workflow on the instance in one request. - Drop version fields: a JavaScript Code node that removes
activeVersionandactiveVersionIdfrom each workflow object so the resulting JSON file can be imported into a brand-new SQLite database without foreign-key violations. - Convert to File: configured with
operation: toJsonandmode: onceso all three workflow objects are serialized into a single JSON array inside one binary item (workflows.json). - Read/Write Files from Disk: configured with
operation: writeto save the binary payload under/home/node/.n8n-files/with a timestamped filename.

Why raw API workflow exports fail with SQLITE_CONSTRAINT: FOREIGN KEY constraint failed
If you connect Get many workflows directly to Convert to File without stripping version fields in between, the backup workflow still succeeds and writes a 6,907-byte JSON file to disk. However, when you copy that raw file into a fresh container (gfl-n8n-up-b) and run n8n import:workflow --input=/tmp/backup.json, SQLite aborts the transaction after 3.1 seconds and imports zero workflows:
SQLITE_CONSTRAINT: FOREIGN KEY constraint failed
Every workflow that has been activated on the source instance carries an activeVersionId UUID and a nested activeVersion object pointing to a specific revision in the source instance's workflow history table. Because a fresh target database does not contain those historical version rows, SQLite rejects the foreign-key reference during n8n import:workflow. The same foreign-key failure was reported by self-hosted operators in an n8n community forum thread, and our test confirmed that raw REST API output reproduces it every time unless those two keys are removed.

http://localhost:5678/api/v1 inside the container rather than a host-mapped port like 127.0.0.1:5691.Configuring the Get many workflows node and the internal n8n API Base URL
Opening the Get many workflows node inspector in n8nio/n8n:1.76.1 shows three required parameters: Credential to connect with (n8n account), Resource (Workflow), Operation (Get Many), and the Return All toggle turned on. The credential requires an n8n API key created under Settings → n8n API and a Base URL.
Because the backup workflow executes inside the n8n container itself, the credential's Base URL must point to the container's internal loopback listener on port 5678: http://localhost:5678/api/v1. During our initial setup we mapped container port 5678 to host port 5691 (-p 127.0.0.1:5691:5678) and accidentally pasted http://127.0.0.1:5691/api/v1 into the credential modal. Inside the container namespace nothing listens on port 5691, so the node immediately failed with The service refused the connection - perhaps it is offline. Switching the Base URL to http://localhost:5678/api/v1 fixed the connection test immediately. Because this API key can read every workflow on your instance, treat it with the same care as any production secret.

Code node JavaScript and the Read/Write Files from Disk path expression
Inside node 2 (Drop version fields), a single JavaScript .map() call uses object rest destructuring to strip activeVersion and activeVersionId from every workflow item while preserving all remaining properties untouched:
// import:workflow on a new instance failed with SQLITE_CONSTRAINT (FOREIGN KEY) until these two fields were removed
return $input.all().map(i => { const { activeVersion, activeVersionId, ...wf } = i.json; return { json: wf }; });
Next, node 3 (Convert to File) runs with Convert to JSON and mode: once so all items from the Code node are bundled into one JSON array rather than writing one file per workflow. Finally, node 4 (Read/Write Files from Disk) uses an n8n Luxon expression for the File Path and Name parameter, starting with a leading = sign so n8n evaluates the expression dynamically on each execution (make sure GENERIC_TIMEZONE and TZ are set in Compose so Luxon backup filenames match local wall-clock dates, as tested in our n8n Luxon GENERIC_TIMEZONE guide):
=/home/node/.n8n-files/backup-{{ $now.toFormat('yyyyLLdd-HHmmss') }}.json

What is inside the 4,711-byte JSON file (and how credentials are referenced)
Comparing the raw API export against the cleaned backup file explains both the 31.8% size reduction (6,907 bytes down to 4,711 bytes) and how n8n handles sensitive credentials during workflow exports. In the raw file on the left, each activated workflow duplicates its entire node and connection graph inside the nested activeVersion object alongside the activeVersionId foreign-key pointer. Removing those two properties eliminates 2,196 bytes of redundant history metadata without altering the live workflow definition.
Just as importantly, inspecting the cleaned JSON on the right confirms that workflow backups never contain credential secrets. Each workflow object stores its id, name, nodes, connections, settings, shared, and meta fields, while credentials appear strictly as an ID-and-name reference stub such as {"httpHeaderAuth": {"id": "WZIFyX4nYvqZL4uq", "name": "gfl fake header auth"}}. Neither the header token value, nor the n8n API key, nor the owner account email appeared anywhere inside the backup file.

Extracting OLD_KEY and understanding the silent credential import trap
Because the workflow JSON only stores credential IDs, a full restore onto a new container requires transferring your encrypted credentials and the source instance's encryption key. Before stopping or replacing the old container, read its encryptionKey from /home/node/.n8n/config into a shell variable without printing the secret to your terminal scrollback:
OLD_KEY=$(docker exec "$OLD" node -e "process.stdout.write(JSON.parse(require('fs').readFileSync('/home/node/.n8n/config')).encryptionKey)")
Then start the fresh target container with -e N8N_ENCRYPTION_KEY="$OLD_KEY" so it initializes its own /home/node/.n8n/config with the exact same key:
docker run -d --name n8n-new -p 127.0.0.1:5679:5678 -e N8N_ENCRYPTION_KEY="$OLD_KEY" -v n8n-new-data:/home/node/.n8n n8nio/n8n:1.76.1
As the terminal capture above demonstrates on container gfl-n8n-up-c, if you forget to pass N8N_ENCRYPTION_KEY, running n8n import:credentials --input=/tmp/creds.json still prints Successfully imported 2 credentials. because the CLI inserts the encrypted ciphertext without attempting to decrypt it. The failure only surfaces later when a workflow runs and aborts with Credentials could not be decrypted.

Creating /home/node/.n8n-files and verifying the written backup archive
Inside the live Read/Write Files from Disk node inspector on port 5678, n8n previews the resolved target path directly below the expression box (/home/node/.n8n-files/backup-20250218-083545.json) and reads the binary stream from the data field produced by Convert to File. If your previous attempts failed with execution errors:
execution 1: error at Read/Write Files from Disk: Access to the file is not allowed.
execution 2: error at Read/Write Files from Disk: The file or directory does not exist
create the sandbox folder as the container's node user, trigger the workflow once, and list the directory contents to confirm the file landed on disk:
docker exec "$OLD" mkdir -p /home/node/.n8n-files
docker exec "$OLD" ls -l /home/node/.n8n-files
After a single execution with three workflows on the instance, ls -l shows one 4,711-byte file owned by node:node:
-rw-r--r-- 1 node node 4711 Feb 18 12:35 backup-20250218-083545.json

Why /home/node/.n8n-files disappears on container recreate unless mounted
Notice two subtle operational details in that ls -l output. First, the timestamp embedded inside the filename (083545) comes from Luxon's $now variable, which uses n8n's configured timezone (America/New_York by default unless you set GENERIC_TIMEZONE=UTC), so it will sits four or five hours behind the UTC modification time reported by ls -l (12:35) unless both variables are aligned.
Second (and far more dangerous for disaster recovery) in a standard Docker setup where your only volume is mounted at /home/node/.n8n (-v n8n-data:/home/node/.n8n), the sibling folder /home/node/.n8n-files lives inside the container's writable overlay filesystem. Whenever you upgrade the image or run docker compose down && docker compose up -d, Docker discards the old container layer and wipes every backup file inside /home/node/.n8n-files. Either copy each backup off the container immediately after it runs, or add a dedicated host bind mount (./backups/n8n-files:/home/node/.n8n-files) in your docker-compose.yml as shown above.

Pre-flight CLI traps: Windows Git Bash path rewriting and Webhook registration delay
Before running the backup and restore commands from a terminal, define the source and target container names in shell variables so every command is copy-pasteable. List your running containers first:
docker ps --format '{{.Names}}'
If you run Docker Desktop from Git Bash on Windows, you must also export MSYS_NO_PATHCONV=1. Without that variable, MSYS automatically rewrites any argument starting with /home/node/... into a local Windows path before passing it to docker exec; in our test, running ls -ld /home/node/.n8n-files without it failed with ls: C:/Program Files/Git/home/node/.n8n-files: No such file or directory:
OLD=n8n # the container that has your workflows
NEW=n8n-new # the fresh container to restore into
export MSYS_NO_PATHCONV=1 # Git Bash on Windows only
Similarly, if an automation script activates the backup workflow via the API or UI and immediately fires curl -X POST http://localhost:5678/webhook/gfl-backup within a few hundred milliseconds, the first request can return HTTP 404 with The requested webhook "POST gfl-backup" is not registered. Adding a 1-second pause after activation allowed the production webhook route to finish registering and return HTTP 200 OK.

Measured file sizes and execution times across 3 runs
To verify whether stripping version fields in the Code node adds meaningful latency or varies across executions, we timed three consecutive runs of the workflow both with and without the Drop version fields Code node, followed by three clean imports into fresh containers:
| Measured on n8nio/n8n:1.76.1 | Run 1 | Run 2 | Run 3 | Median |
|---|---|---|---|---|
| File size, raw API output (no Code node) | 6,907 bytes | 6,907 bytes | 6,907 bytes | 6,907 bytes |
| File size, with "Drop version fields" Code node | 4,711 bytes | 4,711 bytes | 4,711 bytes | 4,711 bytes |
| Backup workflow run time, no Code node | 42 ms | 32 ms | 33 ms | 33 ms |
| Backup workflow run time, with Code node | 38 ms | 48 ms | 52 ms | 48 ms |
n8n import:workflow into a fresh instance | 3.0 s | 3.1 s | 3.0 s | 3.0 s |
Workflow run times are calculated from n8n's internal startedAt and stoppedAt execution timestamps, while import:workflow times include the docker exec process startup overhead. Removing activeVersion and activeVersionId cut the output size by 2,196 bytes (31.8%) while adding only 15 ms to the median run time (48 ms vs 33 ms).

What a workflow JSON backup covers versus a full n8n backup
Before relying on any single backup file for disaster recovery, it helps to compare what each n8n backup mechanism actually writes to disk. The official n8n documentation defines a complete self-hosted backup as the entire /home/node/.n8n directory (which holds the config file containing your encryptionKey and, on default setups, database.sqlite) plus your external PostgreSQL database if you migrated away from SQLite (see our n8n SQLite to PostgreSQL migration guide).
By contrast, the CLI n8n export:workflow --backup command and our in-app 5-node workflow only save workflow JSON definitions. They do not include user accounts, execution history, environment variables, credential secrets, or the encryption key. The distinct advantage of the 5-node workflow is that n8n writes the snapshot from inside the application itself, so once /home/node/.n8n-files exists or is mounted, backups run on a schedule without requiring host cron jobs or SSH access.

Cleaning an existing backup file and importing workflows via the CLI
To restore your newest workflow backup from the source container ($OLD) into the fresh container ($NEW), stream the latest file out of /home/node/.n8n-files, copy it into /tmp/backup.json on the target container, and check whether it still contains any activeVersionId fields:
docker exec "$OLD" sh -c 'cat "$(ls -t /home/node/.n8n-files/backup-*.json | head -1)"' > backup.json
docker cp backup.json "$NEW":/tmp/backup.json
docker exec "$NEW" sh -c 'grep -o ""activeVersionId": *"[^"]*"" /tmp/backup.json | wc -l'
Any count above 0 (our raw file returned 2, one for each workflow that had been activated) means n8n import:workflow will fail with SQLITE_CONSTRAINT: FOREIGN KEY constraint failed. You can strip both fields inside the target container using its bundled Node.js runtime before importing. This one-liner only deletes activeVersion and activeVersionId, so it is completely safe to run even when the count is already 0:
docker exec "$NEW" node -e "const fs=require('fs');const w=JSON.parse(fs.readFileSync('/tmp/backup.json'));fs.writeFileSync('/tmp/backup-clean.json',JSON.stringify(w.map(({activeVersion,activeVersionId,...x})=>x)))"
docker exec "$NEW" n8n import:workflow --input=/tmp/backup-clean.json
docker exec "$NEW" n8n list:workflow

Why every imported workflow starts Inactive by default
When n8n import:workflow --input=/tmp/backup-clean.json runs, notice that the CLI prints Deactivating workflow "gfl test 1 - webhook echo". and Deactivating workflow "gfl backup - all workflows to JSON". before printing Successfully imported 3 workflows. Running docker exec "$NEW" n8n list:workflow --active=true immediately afterward returns empty output, and opening /home/workflows in the browser confirms that all three restored workflows sit in the Inactive state.
The n8n CLI deactivates imported workflows intentionally so that restoring a production backup onto a staging or replacement container does not immediately start firing duplicate cron schedules, polling triggers, or webhook listeners before your credentials are in place. Once you finish importing and verifying your credentials in the next step, toggle on the specific workflows you want active on the new instance.

Complete importable 5-node backup workflow JSON
You can import the complete 5-node workflow below into your own n8n instance via Workflows → Import from File... or n8n import:workflow. After importing, open the Get many workflows node and replace REPLACE_WITH_YOUR_CREDENTIAL_ID by selecting your local n8n account API credential pointing at http://localhost:5678/api/v1:
Show the complete 5-node workflow JSON
{
"name": "gfl backup - all workflows to JSON",
"nodes": [
{
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [0, 0],
"parameters": {
"httpMethod": "POST",
"path": "gfl-backup",
"responseMode": "lastNode",
"options": {}
},
"id": "c0d58f2a-6c5e-4794-a678-3f30d38244dc"
},
{
"name": "Get many workflows",
"type": "n8n-nodes-base.n8n",
"typeVersion": 1,
"position": [220, 0],
"parameters": {
"resource": "workflow",
"operation": "getAll",
"returnAll": true,
"filters": {},
"requestOptions": {}
},
"credentials": {
"n8nApi": {
"id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
"name": "n8n account"
}
},
"id": "49e93691-351a-4ee0-80c3-f829cfa03524"
},
{
"name": "Drop version fields",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [440, 0],
"parameters": {
"jsCode": "// import:workflow on a new instance failed with SQLITE_CONSTRAINT (FOREIGN KEY) until these two fields were removed\nreturn $input.all().map(i => { const { activeVersion, activeVersionId, ...wf } = i.json; return { json: wf }; });"
},
"id": "17d0e62a-3fc8-4645-a9b2-eb04a9c1fff0"
},
{
"name": "Convert to File",
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"position": [660, 0],
"parameters": {
"operation": "toJson",
"mode": "once",
"options": {
"fileName": "workflows.json"
}
},
"id": "3afbf609-d636-4d67-bf39-d6d789511eb2"
},
{
"name": "Read/Write Files from Disk",
"type": "n8n-nodes-base.readWriteFile",
"typeVersion": 1,
"position": [880, 0],
"parameters": {
"operation": "write",
"fileName": "=/home/node/.n8n-files/backup-{{ $now.toFormat('yyyyLLdd-HHmmss') }}.json",
"dataPropertyName": "data",
"options": {}
},
"id": "c8d1d240-aa51-4a6a-892b-1ed407503a79"
}
],
"connections": {
"Webhook": {"main": [[{"node": "Get many workflows", "type": "main", "index": 0}]]},
"Get many workflows": {"main": [[{"node": "Drop version fields", "type": "main", "index": 0}]]},
"Drop version fields": {"main": [[{"node": "Convert to File", "type": "main", "index": 0}]]},
"Convert to File": {"main": [[{"node": "Read/Write Files from Disk", "type": "main", "index": 0}]]}
},
"settings": {
"executionOrder": "v1"
}
}

Exporting credentials, checking the 12-character SHA-256 key hash, and avoiding port 5679 collisions
If you run a restored workflow before importing credentials, n8n stops immediately with Credential with ID "WZIFyX4nYvqZL4uq" does not exist for type "httpHeaderAuth". Before you import credentials into $NEW, verify that the target container's /home/node/.n8n/config holds the exact same encryption key as $OLD_KEY by comparing the first 12 hex characters of their SHA-256 hashes (so the secret key itself is never printed):
docker exec "$NEW" node -e "const k=JSON.parse(require('fs').readFileSync('/home/node/.n8n/config')).encryptionKey;console.log(require('crypto').createHash('sha256').update(k).digest('hex').slice(0,12))"
printf %s "$OLD_KEY" | sha256sum | cut -c1-12
Both lines must print the exact same 12 characters (a60570e3f435 on our source container A and same-key target container B, versus e2693272e11a on mismatched container C). If they differ, recreate the target container with -e N8N_ENCRYPTION_KEY="$OLD_KEY" before proceeding:
docker rm -f "$NEW" && docker volume rm n8n-new-data
docker run -d --name n8n-new -p 127.0.0.1:5679:5678 -e N8N_ENCRYPTION_KEY="$OLD_KEY" -v n8n-new-data:/home/node/.n8n n8nio/n8n:1.76.1
Once the hashes match, export the encrypted credentials from $OLD, import them into $NEW, remove the temporary host copy, and test-run a workflow that uses a credential from the CLI. Pass -e N8N_RUNNERS_BROKER_PORT=5690 so the CLI runner does not collide with the running n8n server's Task Broker on port 5679 (n8n Task Broker's port 5679 is already in use):
docker exec "$OLD" n8n export:credentials --all --output=/tmp/creds.json
docker cp "$OLD":/tmp/creds.json creds.json && docker cp creds.json "$NEW":/tmp/creds.json && rm -f creds.json
docker exec "$NEW" n8n import:credentials --input=/tmp/creds.json
docker exec -u node -e N8N_RUNNERS_BROKER_PORT=5690 "$NEW" n8n execute --id=0uCmWjuajjhkiWPr

End-to-end restore timing breakdown and key-match verification
Looking across the complete backup and restore cycle on n8nio/n8n:1.76.1, the in-app backup workflow finishes in 48 ms median, stripping activeVersionId via Node.js on an existing raw file takes 120 ms, importing three workflows takes 3.00 s median, importing two encrypted credentials takes 1.85 s, and running the CLI execution test with N8N_RUNNERS_BROKER_PORT=5690 takes 1.42 s.
The right panel of the benchmark chart underscores why the CLI execution check is mandatory after every restore: all three containers (A, B, and C) reported 100% success during n8n import:workflow and n8n import:credentials, yet container C (e2693272e11a) had a 0% credential decryption rate at runtime. If your old encryption key is permanently lost, even n8n export:credentials --decrypted fails with Credentials could not be decrypted, and every credential secret must be re-entered manually in the WebUI.

Production disaster-recovery architecture and operational checklist
Bringing all three planes together (the source instance on port 5678, the host sanitization and secret-transfer checks, and the target instance on port 5679) gives you a repeatable disaster-recovery workflow that survives container upgrades and host migrations. On the source side, the 5-node workflow writes pre-cleaned JSON snapshots (4,711 bytes) into /home/node/.n8n-files/, which should be bind-mounted to a persistent host directory (./backups/n8n-files:/home/node/.n8n-files) alongside a pinned N8N_ENCRYPTION_KEY in .env.
When migrating to a new server or recovering from a corrupted container, always verify the 12-character SHA-256 prefix of encryptionKey before running n8n import:credentials, confirm that activeVersionId occurrences equal 0 before running n8n import:workflow, and run a single N8N_RUNNERS_BROKER_PORT=5690 n8n execute test before flipping your restored workflows from Inactive back to Active.

Scope boundaries: what I did not test
To keep the numbers and error messages above strictly limited to what was reproduced in our 3-container Docker lab, here is what was not part of this test:
- Trigger and scale variations: We triggered runs via the production Webhook (
POST /webhook/gfl-backup) rather than waiting on a nightly Schedule Trigger, and we tested with 3 workflows (4,711 bytes) rather than instances with>100workflows, binary attachments, queue mode with Redis workers, or restoring into an instance where those workflow IDs already exist. - Custom sandbox paths and external databases: We tested the default
N8N_RESTRICT_FILE_ACCESS_TO=unsetpath (/home/node/.n8n-files) on SQLite insiden8nio/n8n:1.76.1rather than custom colon-separated directory lists or direct PostgreSQLpg_dumpsnapshots.
n8n JSON Backup Automation & Foreign-Key Restore Q&A
Why does n8n import:workflow fail with a SQLite FOREIGN KEY constraint error on exported JSON?
Exported JSON archives from active workflows contain activeVersionId and versionCounter references that do not exist yet in a fresh target database. Strip activeVersionId with a quick Node.js one-liner before running n8n import:workflow.
Why were all my n8n JSON backups wiped when I ran docker compose up -d with a new image?
Mounting only /home/node/.n8n leaves the sibling /home/node/.n8n-files folder inside the ephemeral container overlay layer. Add an explicit host bind mount (./backups/n8n-files:/home/node/.n8n-files) in docker-compose.yml so JSON exports survive container recreation.
Does a workflow JSON backup include my saved API keys and OAuth tokens?
No. Workflow JSON files store node parameters and credential references, never the secret values themselves. Back up credentials separately with n8n export:credentials and store your 32-character N8N_ENCRYPTION_KEY in an off-host password manager.
Related GearFlowLab guides
- n8n WordPress Workflow: Check Internal Links and Save a CSV: covers the same
Access to the file is not allowed.sandbox restriction when writing CSV audit reports to/home/node/.n8n-files. - n8n SQLite Database is Locked: Fix & PostgreSQL 17 Migration: uses
n8n export:workflow,n8n export:credentials, andN8N_ENCRYPTION_KEYcontinuity while migrating under concurrent webhook load. - Migrate Local Docker n8n on WSL2 to a DigitalOcean Droplet: full volume and container transfer checklist across hosts.
Last reviewed: 2025-02-18. Tested on n8nio/n8n:1.76.1 in Official Docker Desktop (Docker Engine 27.5.1) with synthetic lab workflows and credentials only. File sizes, execution durations, and restore timings are from 3 measured runs each.
Run Prefilled Sizing Math & Download the 1-Page Runbook
Generate systemd or macOS LaunchAgent service watchdogs for automated n8n stacks and size PostgreSQL 17 backup pools.