Hi,
I’m running Syncthing on my laptop, my phone and a Raspberry Pi 4. I would like to have a good back-up plan for my Raspberry Pi. The files are not important, since they are on my laptop anyway.
But to have Syncthing up and running again after a SD-card failure for instance.
Would it be enough to back up the .config/syncthing directory? If I do that, is the service automatically running again, or what else do I have to do or back up?
Yes, essentially. The one caveat to keep in mind is that the index database (index-v0.14.0.db) represents the state of your synced files. If you back up and restore the index database you must also back up and restore the files themselves. If you instead start from a clean slate without database you can also start without synced files and they will get pulled down. The config and keys are safe to back up and restore.
OK, thank you very much.
The data itself is on connected ssd-drives, which are synced with Borgbase. So the data will be there (or is easily recoverable).
I guess I also have to do this, after restoring:
sudo systemctl enable syncthing@$USER
sudo systemctl start syncthing@$USER
Regarding the systemd commands, you can simplify a bit. And please be aware of the difference between a system level service running under so specific user account (syncthing@$USER.service) and a user level service, which starts when the user logs on (but can be made to start on boot as well):
systemctl --user enable --now syncthing.service
Note there is no sudo and it takes only one command. This form can be managed without sudo (root) access later as well.