My question is related to changing OS: If I change OS on a computer but keep the directory for syncing with syncthing on the computer, can I get the newly installed syncthing on the new OS to resume the syncing? If so, what do I need to do?
Here is the setup: I have a desktop and 2 laptops, all 3 with syncthing installed and with the two laptops syncing to the desktop. On all three computers, the OS (all 3 are Linux distros) is installed on a partition separate from the partition on which I store files. Each of the computers has a folder called syncthing on the storage partition and they are all synced together. That is, any changes to Laptop 1 are synced to the Desktop which then syncs to Laptop 2. This works quite well.
I am going to change the OS on the Desktop to a different Linux distro, which obviously will destroy the Syncthing setup on the Desktop, but the syncthing directory on the separate partition will remain unchanged. What is the most efficient way to re-establish the syncing of these 3 computers?
When reinstalling Syncthing, I would just add the existing folder as Receive Only first, let everything sync, override possible local additions, and then change it to Send and Receive for future synchronisation.
Does /home/ count as “the OS” or is that the distinct partition? The Syncthing configuration should be sitting there, and replacing the distro shouldn’t need to wipe it. (That is why user home directories are kept in their own tree, after all.)
I’m not sure I understans what you’re saying. /home is on the same partition as the OS.
Here’s how I set up the partitions. I made 4 partitions: sda1 is the boot partition (I’m using EFI), sda2 is swap, sda3 is mounted as / and that’s where the OS is installed and sda4 is mounted as storage and that’s where I store most of my files.
Odin, I’ve thought more about what you said. I think the reason I started making a separate storage partition but leaving /home with the OS goes back many years to a time I decided to keep storage separate from the OS. I had everything on one partition, so I shrank that partition, and used the empty space to make the storage partition. As a noob (I’m only a little more advanced now), moving /home to that new partition seemed too complicated, so I didn’t. And I’ve used that system ever since.
But after reading your reply, I think when I do the new installation, I’ll put /home on it’s own partition and include storage on that partition. Then I shouldn’t have this problem in the future (except when I replace my two laptops, which are using my old system).
Thanks again. Since I’m going to start using home as my partition separate from the OS instead of /storage, the path to the WILL change. The path I’m currently using is /storage/syncthing/. When I do the new install, I’ll probably just use the default directory /home/randall/Sync/.
After looking at the two links you mentioned, I think the best option for me is essentially a variation of Mark McBride’s option 1-Install syncthing fresh and re-sync folders one by one.
Reading the other link it looks like there’s a lot to do and that makes it prone to the possibility of errors on my part that might break stuff.
I don’t know if you read my second reply to Odin, but the more I think about it, that may not be quite right either. I think the reason I put the storage separate from the OS AND the /home directory is that I was dual booting (actually triple booting) my computer with Windows and two Linux installations and I wanted to be able to mount the storage partition from either Linux installation.
Rather than run the risk of breaking something, I’ll probably do the following. I’m doing this on my desktop which will be single boot only. I’ll just completely wipe it and on separate partitions I’ll have swap, the OS and /home. Then I’ll sync /home/randall/Sync/ on this computer to /storage/syncthing/ on one of the laptops. Once this is done, I’ll restore the sync of the other laptop’s /storage/syncthing/ to the Desktop’s /home/randall/Sync.
I have 2 questions about this.
Will this work without the syncing deleting files from the laptops because there are no files in the desktop /home/randall/Sync/ directory they’re syncing to. My guess is that won’t happen, but I want to make sure before I start.
I’m not the only user on the desktop. I want other users on the computer to have access to the files that are going to be synced. Should I put the directory for syncing somewhere else, not MY home directory, maybe /home/syncthing/ or maybe just /syncthing/?
Let me ask this hypothetical question. Say I have two computers and on each I have a directory /sync_with_rsync, which are identical because I’ve kept them synced with rsync. Let’s say there is a total of 500 files in a variety of directories and sub-directories in this directory. I then do a fresh install of syncthing and set syncthing up to sync these two directories (and everything in them). What does syncthing do in that situation? My guess, after reading about conflict handling at (Understanding Synchronization — Syncthing v1 documentation), is that syncthing will go through the regular conflict handling procedure for each file but I really don’t know what that means.
The referenced document says syncthing recognizes conflicts, but I don’t know what it analyzes to see if two documents conflict or not. If syncthing looks at two documents on different computers, one of which is a document produced by rsync, will syncthing see them as different or will it see them as the same (and therefore non-conflicting)?
And would that apply to syncthing as well? That is, if two different machines were kept in sync by syncthing, instead of rsync, and then the syncthing was removed (including $HOME/.config/syncthing) and reinstalled on both computers, would syncthing see these as different, conflicting files or not? I realize there might be a few anomolies because of versioning.
You can probably see where I’m going with this.Will the procedure described in the paragraph work in my situation of using syncthing to keep my two laptops synced to my desktop? And is that essentially what tomasz86 is suggesting (along with “add the existing folder as Receive Only first”), except it isn’t necessary to remove syncthing from the laptop since I’m not changing anything on it?