I was trying to import credentials and workflows using the CLI and kept running into:
An error occurred while importing workflows. See log messages for details.
ENOENT: no such file or directory, open '/backup-workflows.json'
Which was a bit frustrating because I couldn't figure out why it wasn't working even after copying the backup files as such:
docker cp backup-workflows.json n8n-container:/data
Turns out here’s what I had to do (stumbled upon this after 60+ minutes of trial/error/troubleshooting:
docker cp backup-workflows.json n8n-container:/
docker exec -u node -it n8n-container n8n import:workflow --input=/backup-workflows.json
And it finally worked!
Also make sure you export your credentials decrypted if you’re starting a new n8n instance!
For reference, I’m running v1.38.1 via docker.
I hope this helps someone save a bunch of time and headache haha
Cheers,
bean