Restoring syncthing on new windows

Hi I’m about to reinstall my windows machine, ATM it’s also my backup server via syncthing for my family phones and computers, how do I after I installed Windows get syncthing back running with all its settings it has now so I don’t have to worry. It took me a long time setting it all up once not wanting to do that again if I can avoid it lol.

Posted via my phone so sorry for the long text without structure.

I normally do it this way:

  1. Set all folders to “Receive Only”.
  2. Pause all folders and devices, then shut Syncthing down.
  3. Back up the whole configuration folder (see https://docs.syncthing.net/users/config.html).

Once you’ve reinstalled Windows:

  1. Make sure all your folders use the same paths on the disk.
  2. Restore the configuration to the original path.
  3. Start Syncthing.
  4. Unpause folders one by one, see if everything is fine, then unpause devices.

This assumes that you’re backing up the actual data. If not, then it should still be fine, because the folders set to Receive Only will re-download the data from other devices anyway. The only difference is that if you’re going to re-download, then there’s no point in backing up the database.

1 Like

Yes my pc holds all the data, all folders are set to receive only and ignore delete so everyone can delete backed up files without worry.

There is a full sync folder as well that doesn’t ignore delete and send both ways on each device connected.

So what do I do for the full sync ones as the others based in what you wrote is already done can I keep them full sync or do I need to receive only temp on the day of reinstall?

Yes, I’d recommend changing the one folder type to Receive Only for safety reasons as well. Also, with ignore delete enabled in particular, you should absolutely make sure to back the database up and then re-use it later, as otherwise you’ll lose track of the ignore deleted files.

Backup the database how? Or is that just the folders files goes to or am I missing something? Sorry for the silly questions

I just copy the entire syncthing folder, the .stfolder and the ignore file. Other than a few tweaks for different ignored folders then it’s always worked fine for me. Just remember not to allow the old pc syncthing to run. I usually rename the folders to old

The database is basically the index-v0.14.0.db folder inside the home folder together with config.xml, etc. Just make sure to include it in your backup, and also that you only back it up once Syncthing has been shut down completely right before performing the Windows reinstallation (i.e. so that you’re sure it’s in its final state).

Okay so if I copy the entire synching folder, reinstall windows makes sure all the folders and patch are as before reinstall, install synching and tell it not to start or run then copy old synchthing back, or should I copy old synchthing first then install so it install it’s servers?

Because everything should be where it is now on the new system I hope I make sense?

It depends on what you mean by “installing Syncthing” exactly. If it’s SyncTrayzor, you should be able to restore the old config and database first and install SyncTrayzor later, so that it will reuse the already existing one. The same is true if you just download and run the bare Syncthing executable.

Just to reiterate, normally this process would also be possible without backing up and restoring the database, which is often recommended. Syncthing would just need to rescan all the files from scratch, but other than that, it should just work. The problem is that with ignore delete enabled, you do need to keep the old database or otherwise, with a new database, those files will be treated as normal deletions.

I used synctrayzor that’s what I was referring to, I will backup all its folders, that’s was my intention what I don’t know is do I restore synctrayzor folders which will include database and configuration first then install the program or do I install first then copy everything. I’m semi used to all my launchers like steam either work without installing others need me to install on top of “old” one. Other programs it’s the opposite I need to install first then copy it over due to some registration in windows reg database it needs.

You can back SyncTrayzor up, but that won’t back up Syncthing itself. You need to back up the Syncthing config and database separately. The exact path is listed at the Documentation page linked to in the second post above.

Okay I try and do it all tonight before I shut down cross fingers for me this can go bad lol

I just realized I use the portable version of synctrayzor so not sure if that changes things?

Okay after fiddling with it did I finally get it to work on reboot, I had errors. But now on first work on reboot is it failing to create and get access to 1 of my devices folders. It all worked before reboot, but now it’s as if it can’t access them any ideas?

I’m sorry for replying probably too late for this one, but with SyncTrayzor Portable the situation is quite different, as it stores both its and Syncthing’s configuration inside its own folder, and you probably need to back up only the SyncTrayzor Portable folder to have everything necessary.

Not really sure about the access problems. Usually, it’s caused by Syncthing being run as a normal user, and the folder being located in an administrative location (e.g. the Program Files or another user’s profile folder, etc.). Some screenshots of the GUI with the error may be useful here.

I tried running my third backup because I forgot I had moved it and it worked, and booted on restart. So I took this version moved it into Program Files and it is working but now it won’t boot with system, I’m guessing it’s because it’s under Program Files folder. So Maybe I need to make a Task Scheduler to start it on logon with admin priviligde? I have deleted the corrupt version of portable. Or find another location, I am considering another location as then I never have to worry about backup as I just run it every time I do a clean install and then tell it to boot with OS and voila working. So maybe trying to get it to work in Program Files is a silly idea.

Also no worries on your late reply real life comes first I’m just happy you replying still

If you want to use the portable version of SyncTrayzor, then it definitely should not be placed in the Program Files, but rather in a folder with non-administrative access. If you want to keep it in the Program Files, then you should install the regular SyncTrayzor release (but then the config location will be in %LOCALAPPDATA% instead.

Yep what I thought, I will move it make a folder on my non OS drive for that and 2 other programs I have that are technical portable but aren’t as they just run as is. That way I have them and can avoid having to worry about reinstall. Now I just need a backup app for my PC that backup important things sadly Syncthing can’t do that on local PC. As I want a backup of my portable syncthing in case of issues. Now let’s see if it boot’s I am to tired to test now so tomorrow I know if it’s booting and working with folders as it should. No matter what happens would I like to thank you for all your help in this work.

Hi again.

Ok so I noticed a strange trend that was not here before I reinstalled Windows. Every time my Syncthing boots with OS are some folders stopped See 2 pictures underneath.

and

I then Close SyncTrazor you know right click and Exit, then find it where it sits on my F drive and start it again and voila:

Everything is working as it should.

Got any ideas why it won’t work originally?

Oh the directory is a mlink to another place never been a issue before so no idea why it is now after reinstall, reason for the mlink is the phone my Wife is using is a backup phone while hers is being fixed, and I have a folder for it, so if anyone else needs it can I link there, while the bakcup phones folder link to where I want it saves me 1 step.

Difficult to say why it was working previously and now you’re having errors, but you probably need to delay Syncthing start a bit until the drive becomes fully accessible. How exactly do you start Syncthing on boot?