Restore backups of Workflows

Hi all, just had a question that popped my mind. Let’s say I usually backup all my workflows to a google drive folder or any storage every week once.

How can I restore the backups if I have alot of workflows? Do I add them one by one as I think or is there an easy way to do that in bulk?

Also for the credentials, how do we backup them in bulk and restore them in a new server for example?

Just a question am curious about. Thanks!

Hey @zocket,

All of your questions are answered on this page: CLI commands for n8n | Docs

There is a cli tool that can be used to export workflows and credentials, you can also use it to import them either one at a time or in bulk.

With the credentials it is worth noting that are encrypted, you can export decrypted versions or you can make a copy of the key from the config file (pop it in a password manager, put it on a usb stick and lock it away or whatever you want to do with it) and that way you only need to work with the encrypted values.

Hope this helps :+1:

1 Like

Thanks for the further explanation, didn’t see this documentation. I appreciate your help!

1 Like

Hi, I am trying to bulk export workflows and credentials but it tells me “permission denied”. n8n is self-hosted on my unraid nas (n8n v0.236.3).

I dont know where is the log refered by the error message.

root@NAS:~# docker exec -u node -it <cont_id> n8n export:workflow --all --output=workflows.json
Error exporting workflows. See log messages for details.
EACCES: permission denied, open ‘workflows.json’

Thanks for any help.

Hey @One1Tick,

You don’t have permission to save the file where you are trying to do it, Try adding a folder path that the node user has access to like…

docker exec -u node -it <cont_id> n8n export:workflow --all --output=/home/node/.n8n/workflows.json
2 Likes

Thanks a lot @Jon !

1 Like

@Jon Isnt this method supposed to stop working in 1.x? This is one of the major reason I am not upgrading for now.

Hey @treyr,

Which method? You can still run the docker exec command I shared on v1 and the cli still functions. This is different to say starting a worker on v1 using docker run.

Hi @Jon,
Thanks.
When I run this on V < 1.0
/usr/bin/docker exec -u node -t n8n-digital-ocean_n8n_1 n8n export:workflow --backup --output=/files/backups

I get this message - which implies it wont work in future versions - and if I remember right v1.x already has removed Basic auth (I could be wrong)

Basic auth has been deprecated and will be removed in a future version of n8n. For authentication, please consider User Management. To learn more: https://docs.n8n.io/hosting/authentication/user-management-self-hosted

Hey @treyr,

That message is around basic auth not the command itself and is unrelated, We have removed basic auth in favour of the User Management feature for the web interface. Basic Auth is that little browser pop up for authenticating, Instead of that the option now is the n8n login page.

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