changes to config.xml

I have used to “seed” a new syncthing installation with an config.xml file. Now I want to change the configuration (add or delete folders, change their file versioning detail etc.). I looked into the Rest API for this and found it to focus on replacing parts of the config.xml. This leads to the idea to change/replace the config.xml file with other tools to achieve the same effects? (i.e. is PUT rest/config/ doing anything beyond writing the file content? when is the config read and takes effect?

thank you for the REST API - it is a really clean design!

It is possible to modify the config.xml file directly, but I believe that you also need to restart Syncthing after doing so. Just editing the file will not trigger Syncthing to apply the changes.

Please correct me if there is a way to force Syncthing to “re-apply” the config file while it is already running.

thank you! restarting syncthing after changing the config file is easy.

1 Like

Not after! You can’t modify the file while Syncthing is running. Stop syncthing, edit config.xml, start syncthing again. Or just use the REST api (do you really want to tell me you’d rather deal with xml than json?! :smiley: ).

You actually can… although I would not say that this necessarily is a good idea. Still, editing the file first and then restarting Syncthing does work, i.e. the changes are applied after the restart.

So apparently it can work, it is not supported though. Syncthing might write to config.xml any time, overwriting the changes you made. So let me restate it: Do not edit config.xml while Syncthing is running.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.