How to set the flows_cred.json location?

In my settings.js file I have set flowFile: '/data/node-red/flows.json',
The flows.json file is now located in /data/node-red/. This works as expected, but I also expected the flows_cred.json file to be located in the same folder. That's not the case. It is still stored to /home/username/.node-red/. But the filename is changed to flows_cred.json, instead of flows__cred.json. How can i change the path to the flows_cred.json file?
I am using node-red v0.19.5

Hi @jostor, welcome to the forum.

Node-RED will always place the credentials file in the user data directory, alongside the other user files. There is no option available to have it saved somewhere else.

1 Like

Thanks for your reply and explanation.
I see that it is possible to use another user data directory. Either by setting it in settings.js with userDir or by starting node-red with the --userDir option. Isn't that correct?
If I have an already running system where userDir is set to default (/home/user/.node-red/), and I want to move the userDir to /data/node-red/, can I just move all the files from /home/user/.node-red/ to /data/node-red/ and start node-red with the --userDir /data/node-red/ option? Or will this fail in any way?

Yes. Make sure you include the hidden files in /home/user/.node-red/ - those that begin with a . such as .config.json.

1 Like

Thanks! I will try.

Also, obviously, the user running node red will have to have full access to that folder.

Rather than moving the files you could make /data/node-red be a link to the existing .node-red folder, though that may not be appropriate for your requirements. It can make life simpler when it comes to updating node red for example.

1 Like

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