Changing to Encrypted Storage after backup

I ran a backup with storage set without encryption (no password). I later changed my mind and would like to remove and re-add the storage using encryption. Does this mean I will have to purge the initial backup before I re-run the backup on the encrypted storage? Or will it be able to encrypt what is already uploaded?

Edit: So it appears the short answer here is I have to remove and re-add the storage using encryption. Since I interrupted the initial backup, there is no revision to prune. Will there be unnecessary chunks wasting space at my backup storage location now?

You cannot re-encrypt storage in-place, because this will effectively require downloading all chunks, re-encrypting them, and re-uploading them anyway – so you might as well do it into new datastore, without running the risk of leaving datastore in intermediate state.

So you would want to duplicacy add another, copy-compatible encrypted storage to the same repository and then simply duplicacy copy -to <new_encrypted_storage>.

Once everything is good – delete original storage.

1 Like

Here is an illustration of copying from unencrypted into encrypted copy-compatible storage:

/tmp % mkdir source target1 target2
/tmp % echo filecontent > ./source/file1.txt
/tmp % cd source

source % duplicacy init -storage-name target1 source-snapshot /tmp/target1
/tmp/source will be backed up to /tmp/target1 with id source-snapshot

source % duplicacy backup
Storage set to /tmp/target1
No previous backup found
Indexing /tmp/source
Parsing filter file /tmp/source/.duplicacy/filters
Loaded 0 include/exclude pattern(s)
Packed file1.txt (12)
Backup for /tmp/source at revision 1 completed

source % echo another text > ./file1.txt

source % duplicacy backup
Storage set to /tmp/target1
Last backup at revision 1 found
Indexing /tmp/source
Parsing filter file /tmp/source/.duplicacy/filters
Loaded 0 include/exclude pattern(s)
Packed file1.txt (13)
Backup for /tmp/source at revision 2 completed

source % duplicacy add -e -copy target1 target2 source-snapshot /tmp/target2
Enter storage password for /tmp/target2:********
Re-enter storage password:********
/tmp/source will be backed up to /tmp/target2 with id source-snapshot

source % duplicacy copy -from target1 -to target2
Source storage set to /tmp/target1
Destination storage set to /tmp/target2
Enter destination storage password:********
Chunks to copy: 8, to skip: 0, total: 8
Copied chunk 7ca258dea704bcefdda5fb4301fcd0c48b328a886019fd81e615b46afb546950 (1/8) 3KB/s 00:00:00 12.5%
Copied chunk 58a7470011ec8dae59d6809bc9ecf393975e4abb7c7b093dda5503adbf6c8d7a (2/8) 1KB/s 00:00:00 25.0%
Copied chunk 0be978758e504f0379a5a82555e010410386dc2b4a8f5179b3fc94df53597823 (3/8) 1KB/s 00:00:00 37.5%
Copied chunk 85421445735bdf65cb4cdd339f93743df69dc66eca56de625ec4accfb59d5163 (4/8) 3KB/s 00:00:00 50.0%
Copied chunk c63832fbbe9c1280dbfcf5332dfbea32ff6ea8762932aa318ce52bc310ff362b (5/8) 3KB/s 00:00:00 62.5%
Copied chunk 60729f2c85e081c7ab3318cb3e5ae1a2b5db71d315410862022e28956894b51e (6/8) 2KB/s 00:00:00 75.0%
Copied chunk 9387d2d7c909019e13af9bd13fd095aa8f15084ffa401e82e8ca619b3697e60e (7/8) 2KB/s 00:00:00 87.5%
Copied chunk e7f0788177e63e39ce0e6a98a329d96c2272745e554e6c2007d8e3c7e5df31e8 (8/8) 3KB/s 00:00:00 100.0%
Copied 8 new chunks and skipped 0 existing chunks
Copied snapshot source-snapshot at revision 1
Copied snapshot source-snapshot at revision 2
1 Like

Thanks for the reply. When you say “delete the original storage” after completing the copy, do you mean from the GUI or also a folder in my OneDrive account where I’m backing up to? Also, the path on OneDrive is the same for multiple computers.

Is it not possible to just delete the snapshot and uploaded chunks from OneDrive and re-create the storage to be encrypted? I only completed a partial backup before realizing that I wanted it to be encrypted. I just didn’t want to leave a 100-200GB of orphaned data from that stopped backup out on OneDrive that would be taking up wasted space.

If you’re starting from scratch, then better to start from scratch and delete the destination storage files in the OneDrive - that means the config file, snapshots and chunks (and possibly fossils) directories. Make it empty.

I have other computers backing up to the same path. So I don’t think I can delete these folders without effecting my other backups. Maybe I can delete the effected sub folders within the snapshot and chunks folder (with backup ID of the computer’s name that I interrupted) though?

So you want to keep original unencrypted storage where other machines backup to, and create new encrypted storage for some other machines, and then purge backup from those other machines from the unencrypted storage?

You can delete the snapshots folder with the backup ID, then ensure nothing else is touching that datastore and run prune -exhastive -exclusive to delete the unreferenced chunks.

When I remove the storage from the GUI and try to re-add it again using the same name, it doesn’t prompt for encryption. Why not and how can I fix that?

You’ll need to create a new storage. You can’t change the encryption setting of an existing storage. @saspus’s instructions were for cleaning up the existing storage to get rid of unreferenced chunks.

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