Just copy the config.xml, cert.pem and key.pem. I actually have a Syncthing folder setup on remote devices to sync that back to a trusted local machine (folders are setup send-only, receive-only).
If you save the config.xml the remote Device IDs and folder IDs (as well as local paths) are already saved.
If you save the cert.pem and key.pem you have saved your own device ID. It is impossible to recreate the Device ID without these, so saving the local device fingerprint (“Device ID”) is unnecessary.
No need to make note of all those folder IDs and remote device IDs unless you want to reconstruct the config because the config.xml was not saved.
As long as the local folder paths are the same:
- For safety, set all the remote folders to “Send Only”.
- Install Syncthing on the replacement device (wait for an automatic upgrade if needed).
- Stop Syncthing.
- Copy over the config.xml, cert.pem and key.pem that you saved from the old device.
- Start Syncthing.
- It will see that the folders don’t exist and should create them and copy files back.
- Once they are in sync, set the remote folders back to “Send & Receive”.
Note that any .stignore files you had on the old device will be lost because they are not synced, and do not get stored in the config.xml.
One workaround is to use an #include file in the .stignore and maintain the Ignore patterns there. But it makes maintenance more onerous because to edit the ignore patterns you have to open that file with another app.
Where its possible, you can use identical ignore patterns on both sides; it is redundant, but it preserves the patterns. This is not always possible.
A final alternative is to run a periodic script to copy every .stignore to device-parent-folder.stignore (where device- is hard-coded in your script). This file would be synced.