If you specify the flow name in the command line it will always load that flow & therefore hostname is irrelevant.
>node-red --help
Node-RED v1.0.4
Usage: node-red [-v] [-?] [--settings settings.js] [--userDir DIR]
[--port PORT] [--title TITLE] [--safe] [flows.json]
Options:
-p, --port PORT port to listen on
-s, --settings FILE use specified settings file
--title TITLE process window title
-u, --userDir DIR use specified user directory
-v, --verbose enable verbose output
--safe enable safe mode
-?, --help show this help
Documentation can be found at http://nodered.org
e.g. start node-red and specify the flow file... node-red myflow.json
Alternatively...
Edit the settings.js file...
// The file containing the flows. If not set, it defaults to flows_<hostname>.json
//flowFile: 'flows.json',
I'm automatically launching node-red via systemd, I'm not hot to dive into how it is actually doing it, so changing the command line would be a last resort.
The second method suggests I wouldn't have the problem if the default flows file was flows.json instead of flows_hostname.json.
On the next system I clone, I'll edit settings.js and un-comment flowFile to make it:
flowFile: 'flows_{nameOfSystemBeingcloned}.json',
Presumably when the cloned system boots with the new hostname it'll then still use the original flows file.
Short answer, no, haven't tried it yet, but I will be cloning another system (AtomicPi) in a week or two. I'll follow up if it doesn't work.
Editing the the settings.js file will be simple, figuring out how to make systemd launch it with a different command line parameter, not so much.
Systemd is something I hold my nose and just use, and since it generally "just works" I'm happy to ignore it, but when it goes wrong I end up cussing alot
If you rename the old file as that name and start node-red what does it say then? If it says it is creating a new file then Deploy and see if it overwrites the file. I would put a small wager on the possibility that either you are looking in the wrong folder or there is a small error in the filename. Remember that if you are on a Linux system then file names are case sensitive.
I'm trying to avoid post cloning futzing around beyond changing the hostname, which is not always necessary, and then I don't have any problem.
Steve-Mci's suggestion of editing the flows file to specify the original flowFile name seems perfect as I already have to edit the settings.js file to add some require() statements when I initially setup the system that I plan on cloning.
If you're cloning the system, why not just use the same flow file name on every system? As suggested, rename the flows file to e.g. flows.json and edit the same name to settings.js (before cloning). Then you'd have NR running straight away on a cloned system with or without changing the hostname.
I didn't know how it was supposed to work which is why I asked. I've cloned enough systems that its been a constant irritation. I guess its possible I made a typo.