How to save configuration of Syncthing

Hi,

I have set up Syncthing between 2 Linux Mint PC, a Windows Netbook and 2 Andriod phones… everything is working fine except for a few minor issues ( which I see others have mentioned so I am tracking their progress)

As a result, I have just bitten the bullet and un-subscribed from DripBox.

My question… how do I save the configuration on each Syncthing device so that I can re-install if/when needed?

Thanks, Tony

You need to backup these files: https://docs.syncthing.net/users/config.html#description

You should only backup the index-*.db directory, if you can make sure that the the synced files will be the same after restore. Otherwise you will for sure get conflicts.

1 Like

Or worse, syncthing will assume the files are gone (deleted) and propagate the deletes to everyone.

1 Like

In other words, backup .config/syncthing and ignore index-*.db – is that correct?

I’m not sure why I would ever want to backup index-*.db files, except to perhaps save rescanning and bandwidth to other nodes?

1 Like

Thats the reason, yes. Initial scanning can take very very long.

So that raises an interesting question: if my total config directory is ~350Mb, is Syncthing going to exchange that much data with other nodes to “recreate” the index?

I’m not sure, but I have set

My Device -> Advanced -> Compresson -> Metadata Only

Dunno, how much this saves, but one of my config directories is about 14GB, I doubt, it’s all transfered :slight_smile:

The database is many things, only part of it is what is exchanged.

1 Like

Hi, I don’t recall changing the default config on install but I am finding the config in this folder

~/.var/app/me.kozec.syncthingtk/config/syncthing

with contents of

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

Does this look correct?

This is the location gtk wrapper uses, plain syncthing uses a different location.

Yes.

You’re particularly interested in the files cert.pem, config.xml, key.pem. These files are crucial. You may however back up the entire directory, just in case (possible changes to the files inside directory in the future, etc).

Just be aware that files named like <number>.ldb (inside a index-*.db folder) contain the database. The database can be rebuild without much trouble and restoring the database from a backup can cause errors, so it might be best to not restore it after a re-install.