Migration
Updated July 19, 2022 by luwol03 and ShaquuMigration to new setup
There are some cases when you may want to move your HomeKit devices to a new Node-RED instance while not changing your Home App pairings. This could be when you are migrating to a new computer, flashing a new SD card for your pi, or restoring from a backup. While not guaranteed, this process should allow migration without needing to remove your bridge or standalone devices from the Home app.
How to do it!
Moving to a new server is fairly simple, and only takes a few of steps,
- Install Node-RED on your new server
- Shut down Node-RED on the old server
- Changed to the
.node-reddirectory on the new server and runnpm install node-red-contrib-homekit-bridged(and any other node modules you use in your flows) - Copy over
homekit-persistfrom the.node-reddirectory on the old server to the.node-reddirectory on the new server - Copy over
flows_<old machine's hostname>.jsonfrom the.node-reddirectory on the old server to the.node-reddirectory on the new server - Rename the
flows_<old machine's hostname>.jsontoflows.jsonon the new server. - Edit the
settings.jsfile on the new server, and uncomment the line `flowFile: ‘flows.json’ - (Re)Start Node-RED on your new server.
Migration to new flow
Sometimes you want to move Service node between flows. Unfortunately simple copy and paste will cause the node to have it’s id regenerated. New id means that HomeKit will loose data about that Service which can cause some settings missing in Home.app (like room assignment etc. for that Service).
- Create new flow in Node-RED. If already created make sure that you have at least one (any) node in it.
- Note node.id of the Service node you want to move to new flow.
- Backup your files that are in
.node-reddirectory - Shut down Node-RED
- Locate flows file
flows_<machine's hostname>.jsonand open it - Locate node in the flow file. Example
"id":"6bed989d.116308","type":"homekit-service","z":"6c3f03b4.f0351c" zis flow id. Change it to new flow id.- Save file and start Node-RED.