K8s Restoring a NodeRed Instance with Projects

I have several scripts that backup the NodeRed data directory including all the configurations and directories for restoration to new instances on other k8s clusters, however I come across random issues whereby when the data is pre-staged into the data dir and NodeRed is then started and appears to clear down the .config.projects.json which then causes the active project not being set or any references to any projects within the /projects directory.

This is on an older node red release 3.0.2 so appreciate this maybe an old bug but cannot see any obvious on GitHub, can anyone advise on how config is loaded and saved to the data directory and what triggers these file operations?

Node-RED uses a settings file called settings.js to configure its behavior. By default, this file is located in your Node-RED user directory (usually ~/.node-red). If the file doesn’t exist, Node-RED creates a default settings file in that directory. You can also specify a different settings file using the --settings command-line argument when starting Node-RED.