How to Recreate Syncthing Plugin Configuration

I have Syncthing running on FreeNAS (FreeBSD-Syncthing v1.8.0), and very soon I am going to need to upgrade to TrueNAS which means that I will likely have to rebuild Syncthing from scratch (The upgrade will likely also upgrade the Syncthing binary as well). Unfortunately the autoupdate function doesn’t seem to be enabled.

The plugin config directory is

config dir: /usr/local/etc/syncthing

and it contains the following files: cert.pem config.xml csrftokens.txt https-cert.pem https-key.pem key.pem

If I just backup this directory and restore it to the same path in the new jail will that work? Is there anything else I need to backup/restore?

Will Syncthing automatically update it’s config when the program version changes?

Any help would be much appreciated.

Things installed via package managers never auto-update.

You can back those files up to maintain the device id/configuration.

1 Like

Thanks for the reply. Just for clarity, are you saying that if I back up the contents of the config directory /usr/local/etc/syncthing and then restore it once I have done a clean install of syncthing that everything should work just as it did before?

You likely don’t want to back up and restore everything. It’s likely that the database is stored in the same place. The safe option is not to restore the database, only the keys and config. Then all files will be reindex. If you are 100% certain that all data and all paths are the same after upgrade, then you can also keep the database. If data disappears (e.g. because it’s at a different path) and you keep the database, all files will be marked as deleted and thus also deleted on other devices.

Thanks @imsodin just to make sure I understand correctly.

I have: Machine1: /home/user/syncdir1 Machine2: /home/user/syncdir2 and they are both in sync, and syncthing is functioning correctly.

I need to update syncthing on machine1, so I backup /usr/local/etc/syncthing which contains the following files:

cert.pem config.xml csrftokens.txt https-cert.pem https-key.pem index-v0.14.0.db key.pem

I delete, the entire syncthing install (which is essentially in a virtual machine, and I delete the whole machine.) I then recreate syncthing (with the updated version) and restore /usr/local/etc/syncthing with the exception of index-v0.14.0.db (which as I write this is a tiny file of only 12 bytes.

Am I correct in assuming that syncthing will create a new db file, rescan syncdir1 and more or less instantly be back in sync [directory was in sync before the update and nothing has changed]?

Since the db file is so small I’m assuming that it only keeps track of new additions and deletions until the program has a chance to get everything back in sync. I want to make sure that syncthing doesn’t empty both directories.

index-v0.14.0.db is not a file but a directory, and definitely bigger than 12 bytes. The db holds information on all files that are in Syncthing folders, not just changes.

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