How to backup Syncthing configuration and database


(Zilexa) #1

I am running Syncthing on my Raspberry Pi2 which is running OSMC (based on debian upstream).

Now I want to do a clean install of my Raspberry Pi2, but I when I install Syncthing again, I want to make sure I don’t have to configure all sync folders again and also make sure Syncthing wont have to scan all directories again, generate keys etc etc.

How can I create a backup of Syncthing itself, its settings/configuration, cache etc?


(Felix Ableitner) #2

The configuration and database are stored in ~/.config/syncthing/.


(Kluppy) #3

Be very careful if you restore the database but the files are missing synching will treat them as deleted and propagate the change globally.

There should be a margin of safety in that the .stfolder file will probably be missing but I would keep the configuration and blow away the database personally.


(Zilexa) #4

Wouldn’t SyncThing simply believe the drive is not available, if the folder containing sync folders is missing? Or if the drive containing the sync folders is simply not mounted?


(Kluppy) #5

Yes, that is what I meant by a margin of error. The .stfolder file came about so that Syncthing can recognise when a mount is missing etc.

There are still plenty of other things I would be careful of. For example, I have accidentally swapped mounts around when rebuilding a system before. It would not have been funny if I had Syncthing running before I noticed.


#6

I am just setting up a new pc and copied the config.xml. Can I just overwrite the config.xml or will this delete the files on other devices?


(Jakob Borg) #7

The config.xml is fairly safe to copy (assuming you have folders in the same place as before), but to retain the device ID you also need to copy the key.pem and cert.pem files.