Reorganizing folder results in files being transferred again

I’m using Syncthing to back up a 2TB media server. I recently encountered the need to put each video file into its own folder (e.g. “Movie.mkv” into a “Movie” folder). I tried doing this a few ways…

Trial 1

  1. On Node A, create folder Movie
  2. Move Movie.mkv into Movie Result: Node B deletes local copy of Movie and redownloads Movie.mkv from Node A

Trial 2

  1. On Node A, create folder Movie
  2. Wait for sync (this took minutes, but that was fine)
  3. Move Movie.mkv into Movie Result: Node B moves the local copy correctly

Based on Trial 2, I tried about 20 movie files at once. MISTAKE! For some reason, I got the results of Trial 1 and am now redownloading over 100GB. :frowning:

Thoughts on how to do this? Thank you.

There is no guarantee that data will be reused when things are moved between folders, where “folder” is the syncthing concept that is shared with devices and so on. When files are moved between directories within the same folder, data reuse should always happen.

If you want to reorganize and ensure no unnecessary data is transferred, a slow but sure way is to copy, rescan, let sync, then delete.

Thanks for the reply and clarification.

This data is being moved within directories within the same synced folder. But from the root of that folder into a new subdirectory.

OK, so your slow way would be…

  1. Create new directory Movie
  2. Copy Movie.mkv into Movie
  3. Let rescan and sync
  4. Delete old copies

?

Thank you!

There sadly is no guarantee that stuff will be reused. Syncthing sends changes as soon as it discovers them, so it’s perfectly possible that it will discover that Movie.mkv is missing, transmit that as a delete, get that handled at the other end, and then discover Movie.mkv in a different place.

If it’s within the same folder that shouldn’t happen?

Uh, unless inotify, I guess, maybe.

Yeah, that’s unfortunate. I was hoping that even by waiting and taking my time with it to let syncs and scans happen, that it would solve this.

If you have the space on the remote node… You can set versioning to keep a single copy. Then add the stversion folder to the node as a new share without sharing it to any other devices.

When you move your files ST will do it’s best to move them rather than delete and re-download. If it does delete rather than move, it can rebuild the file from the on disk copy without needing to download anything.

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