What happens if the actual contents in a storage changes

What happens if the actual contents in a storage changes but everything else keeps the same, i.e. filters, storage name, snapshot id …

The usecase is this, I use 2 external harddisks for backups and I swap them every 1-2 months when I visit my parents. So I wonder what happens if they use the same drive letter and the Duplicacy folder is at the same path etc. Will this just work as, what’s backupped, depends on what Duplicacy finds at the storage during the execution of a backup? Or will it go wrong because what’s in the cache of the current repository does not match what’s actually in the storage after I swapped the drives?

My understanding is that duplicacy just goes off of what’s in the destination storage. If you look at your destination, you see the list of snapshots made on that storage - all the info about actual backups is there, not in your local .duplicacy directory.

The snapshot files in the local cache may become a problem, as snapshot files in two storages may have the same revision number but yet they are different.

For example, suppose you have been backing up to the first storage recently and the latest revision is 30. Now you switch to the second storage where the latest revision is 15. Duplicacy finds the local copy of the snapshot file named 15 in the local cache. However, this snapshot file 15 is a local copy of the snapshot file 15 in the first storage so it is different from the same file in the second storage. And it may reference some chunks that only exist in the first storage but not the second one.

The workaround is to remove all snapshot files in the local cache (rm -rf .duplicacy/cache/default/snapshots) before every backup operation. You can create a pre-backup script that does this automatically.

That makes sense. I guess in my case it’s simpler to just change the used storage those few times I swap the drive.

Thanks for the clarification.