UIBuilder backup and git

I use git with my node red instances for history and backup. For non-uibuilder instances I commit everything to git except node_modules, context, .config.users.json and .backup files generated by node-red. If I have to restore the system I can then clone the repository, run npm install to install any additional nodes used, and start node-red.

Now I am proposing to use uibuilder, in particular markweb. What in the uibuilder folder should I commit to the repository and what will be automatically regenerated when I run node-red for the first time?

Great question Colin.

When installing the UIBUILDER package and restarting Node-RED, you will get a uibRoot folder which, by default will be <userDir>/uibuilder/ (e.g. ~/.node-red/uibuilder/). If you are only using Markweb, then it is not critical that this folder is backed-up as it would get recreated anyway. However, it is probably best to back it up anyway in case you use other UIBUILDER features in the future.

The one thing to remember about the uibRoot folder is that it is another npm root. Which means that it can contain another node_modules folder that you should exclude from backups (and would require another npm install in that folder to restore things). That folder would contain any optional front-end libraries that you might install (which makes it easy to use them in your uibuilder and Markweb pages). For Markweb alone, there shouldn't be anything in there.

The other folder(s) of note will be your Markweb root and, optionally config folders. These can be anywhere reachable by Node-RED. So if you put them inside your userDir folder, they should already be in your backups. If not, then you should either add them or have a separate backup for them.

As long as you've backed up and restored everything and run the appropriate npm install commands, your restored flows should be quite happy and simply pick up where they left off.

Great, thanks Julian.

I think I need to exclude uibuilder/config/telemetry.json from git. It seems to be updated every time the site is accessed.

Good point, I forgot about that new file. That file is not critical. It will be re-created, albeit with a new UUID, if lost.