I want to replicate my Syncthing configuration from one device to many others. Can this be done efficiently? How?
I don’t want to set up each device by hand because there are a lot of shared folders and a lot of devices. It will be tedious to do that manually.
What I tried so far:
I took the original configuration file and replaced the folder GUID’s with new ones, then copied that file to a new device, retaining that device’s own unique ID. However, Syncthing fails to start. I assume it is looking for those specific folder GUID’s to exist in its database?
So far I have not found any documents on copying a conf.xml from one device to multiple others.
You haven’t provided any errors explaining why it would fail.
I’ll try again. From your reply, I assume it should work. After I try again, if I can’t get it to work, I’ll post the log or console output. Thank you.
Do you mean the GUI API key?
Also, “fails to start” should generally mean there’s an error. Telling us what it is reduces guesswork.
What I have gathered from this thread is that I should be able to simply copy a working config file from one device to a new device. That’s mainly what I needed to know. (If that is how it can be done, I’m sure I’ll sort out the details. If not, I’ll reply with specific error messages.) Thank you.
I have this working now. I can indeed copy a complete configuration file from an existing device to a new one. It requires only minor editing of the configuration. I have done it for a couple different devices today and I did not have any problems – as long as I let syncthing make the device id’s.
What I’m doing now is starting syncthing on the new device to let it generate a config file and device ID. Then I shut it down, copy the device ID, and edit the config file as required.
I would like to know if I can create my own GUID’s for the new device’s ID. Then I could simply copy the new config file into place using my own GUID to further simplify my steps.
In my OP, I mistakenly called the device ID’s “folder GUID’s”. Anyway, I am talking about the device id that looks like this in the XML config file:
Can I make those up myself (e.g., using
uuidgen on the Linux CLI)? Do they have to meet any specific formatting rules or other criteria?
Using my own ID’s is the only part of the process that seems to be giving me any trouble.
uuidgen generates a GUID that is a different length than the one that syncthing generates. Here’s an example:
Could that be the cause of my original problem? Thank you.
syncthing -generate one. They are not guids, you can’t make up your own. https://docs.syncthing.net/dev/device-ids.html
I see. That makes sense now. Thanks for the link. That’s excellent documentation.
When I copy the conf.xml file to the new device, I am editing just these fields:
- device name (occurs in one place)
- device ID (change everywhere: use new one generated by
- device listen port (required by my approach, which is modeled on https://wiki.archlinux.org/index.php/Syncthing#Local_network_setup)
However, do I also need to change the
apikey in the
Is there anything else I should change when copying the conf.xml to a new device?
The API key doesn’t have to be changed but best practice suggests you would change it.
It is used to by the rest API to authenticate request so a malicious actor with your API key can issue commands / take control of your Syncthing instance.
If, on the other hand, you are using a bot to control multiple ST instances and, like me, you are lazy. Only having one API key can make things simpler… Not best practice but sometimes worth the trade off
Thanks for your very helpful answer. I think I will do like you.
Also, none of my devices are on the public internet.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.