# Re-establish syncing with new syncthing, but old synced directory

**URL:** https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239
**Category:** Support
**Created:** [January 24, 2021, 1:21pm UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239 "2021-01-24T13:21:15Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![rpeasal](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rpeasal](https://forum.syncthing.net/u/rpeasal)
#### Post date: [January 24, 2021, 1:21pm UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/1 "2021-01-24T13:21:15Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![tomasz86](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/96bed5/32.png) [@tomasz86](https://forum.syncthing.net/u/tomasz86)
#### Post date: [January 24, 2021, 1:52pm UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/2 "2021-01-24T13:52:40Z")

</div>

> [@rpeasal](#):
>
> 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?

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.

---

<div class="post-metadata">

### Author: ![rpeasal](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rpeasal](https://forum.syncthing.net/u/rpeasal)
#### Post date: [January 24, 2021, 3:12pm UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/3 "2021-01-24T15:12:16Z")

</div>

Thanks, tomasz86, that seems logical. It will probably be next weekend before I have a chance to install the new OS, so don’t expect a report on how it went or any followup questions before then.

---

<div class="post-metadata">

### Author: ![odin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/odin/32/5905_2.png) [@odin](https://forum.syncthing.net/u/odin)
#### Post date: [January 25, 2021, 10:39pm UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/4 "2021-01-25T22:39:31Z")

</div>

> [@rpeasal](#):
>
> 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.

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.)

---

<div class="post-metadata">

### Author: ![rpeasal](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rpeasal](https://forum.syncthing.net/u/rpeasal)
#### Post date: [January 27, 2021, 10:35am UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/5 "2021-01-27T10:35:31Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![kluppy](https://forum.syncthing.net/user_avatar/forum.syncthing.net/kluppy/32/4197_2.png) [@kluppy](https://forum.syncthing.net/u/kluppy)
#### Post date: [January 27, 2021, 10:44am UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/6 "2021-01-27T10:44:25Z")

</div>

It is common on Linux to mount the data partition to `/home` so all users data is seperated from the OS.

If you didn’t mount the data directory to `/home` then you probably lost the config and database when you re-installed.

---

<div class="post-metadata">

### Author: ![rpeasal](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rpeasal](https://forum.syncthing.net/u/rpeasal)
#### Post date: [January 27, 2021, 11:26am UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/7 "2021-01-27T11:26:10Z")

</div>

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 for the reply.

---

<div class="post-metadata">

### Author: ![rpeasal](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rpeasal](https://forum.syncthing.net/u/rpeasal)
#### Post date: [January 27, 2021, 11:31am UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/8 "2021-01-27T11:31:59Z")

</div>

Thanks for the reply. kluppy.

Regarding your first sentence, please refer to my 2nd reply to Odin. In that, I mentioned that in the future I’ll put /home on a different partition.

Regarding your second sentence, I haven’t done anything YET. Do you have any suggestion on how to do this migration? Is there some way to export and then import the config and database you mentioned?

---

<div class="post-metadata">

### Author: ![kluppy](https://forum.syncthing.net/user_avatar/forum.syncthing.net/kluppy/32/4197_2.png) [@kluppy](https://forum.syncthing.net/u/kluppy)
#### Post date: [January 27, 2021, 11:41am UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/9 "2021-01-27T11:41:38Z")

</div>

The default location for the database, certificates and configuration on Linux is `~/.config/syncthing`.

You can copy these to the new system if the paths to the shares stay **exactly** the same.

If they do not match you could in theory loose data but the folder markers should prevent that.

**Edit:** If the location of the shares change you can update the config.xml but again be careful not to mess it up.

---

<div class="post-metadata">

### Author: ![rpeasal](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rpeasal](https://forum.syncthing.net/u/rpeasal)
#### Post date: [January 27, 2021, 11:50am UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/10 "2021-01-27T11:50:08Z")

</div>

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/.

---

<div class="post-metadata">

### Author: ![odin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/odin/32/5905_2.png) [@odin](https://forum.syncthing.net/u/odin)
#### Post date: [January 27, 2021, 11:56am UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/11 "2021-01-27T11:56:59Z")

</div>

> [@rpeasal](#):
>
> 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.

Personally, I have /home/ on its own partition, and have a separate data storage on a larger HD. It all depends on how you want to set things up.

> [@rpeasal](#):
>
> 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/.

There are ways to fix that - either by changing the syncthing config file before starting it on the new setup, or by being creative with the filesystem mounts. I’d probably go with the former.

---

<div class="post-metadata">

### Author: ![kluppy](https://forum.syncthing.net/user_avatar/forum.syncthing.net/kluppy/32/4197_2.png) [@kluppy](https://forum.syncthing.net/u/kluppy)
#### Post date: [January 27, 2021, 11:57am UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/12 "2021-01-27T11:57:36Z")

</div>

Personally I would copy the data and modify the config file. If you are sure you haven’t changed any of the local files tomasz86 suggestion is a safer option.

> [@tomasz86](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![kluppy](https://forum.syncthing.net/user_avatar/forum.syncthing.net/kluppy/32/4197_2.png) [@kluppy](https://forum.syncthing.net/u/kluppy)
#### Post date: [January 27, 2021, 12:06pm UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/13 "2021-01-27T12:06:51Z")

</div>

FYI:

> [@Documentation for Migrating to a New Server](https://forum.syncthing.net/t/documentation-for-migrating-to-a-new-server/14768):
>
> Longer time syncer, first-time poster. I was chatting in the IRC syncthing channel regarding best practices to migrate an existing server. We discussed a few options, but one thing we agreed on was that this isn’t sufficiently covered in the official documentation, and I’d like to propose it be added. For example, I just recently migrated a server from Fedora to Void (worth checking out, btw) and wasn’t sure if I should: Install syncthing fresh and re-sync folders one by one Same as 1, but st…

Also within that thread,

> [@How to save configuration of Syncthing](https://forum.syncthing.net/t/how-to-save-configuration-of-syncthing/13483/11):
>
> 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…

---

<div class="post-metadata">

### Author: ![rpeasal](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rpeasal](https://forum.syncthing.net/u/rpeasal)
#### Post date: [January 27, 2021, 1:21pm UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/14 "2021-01-27T13:21:13Z")

</div>

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.

1. 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.
2. 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/?

---

<div class="post-metadata">

### Author: ![rpeasal](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rpeasal](https://forum.syncthing.net/u/rpeasal)
#### Post date: [January 27, 2021, 9:03pm UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/15 "2021-01-27T21:03:49Z")

</div>

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](https://docs.syncthing.net/users/syncing.html#conflict-handling)), 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?

BTW-Sorry for the long winded posts.

---

<div class="post-metadata">

### Author: ![kluppy](https://forum.syncthing.net/user_avatar/forum.syncthing.net/kluppy/32/4197_2.png) [@kluppy](https://forum.syncthing.net/u/kluppy)
#### Post date: [January 28, 2021, 7:33am UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/16 "2021-01-28T07:33:38Z")

</div>

ST will compare the files and if they match will consider them in sync.

This includes content permissions etc.

If anything is different in one of the files they will be considered to conflict because there is no history for either.

What tomasz86 is suggesting essentially forces the receiving device to change it’s local additions to match the global state without generating conflicts that are synced to the global state.

---

<div class="post-metadata">

### Author: ![rpeasal](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rpeasal](https://forum.syncthing.net/u/rpeasal)
#### Post date: [January 28, 2021, 2:31pm UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/17 "2021-01-28T14:31:45Z")

</div>

Kluppy, thanks for the explanations.

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [February 27, 2021, 2:32pm UTC](https://forum.syncthing.net/t/re-establish-syncing-with-new-syncthing-but-old-synced-directory/16239/18 "2021-02-27T14:32:29Z")

</div>

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