Can a Backup ID be changed?

I’d like to change a BackUp ID. Is there any way to do this other than deleting and re-creating a backup with a different Backup ID?

  • Delete the storage with an old backup id from webui
  • rename the folder on the storage under snapshots from old backup id to new backup id
  • add the storage again with a new backup ID in web ui

That is if you use webui. Else — .duplicacy/preferences.

I tried this but I got cipher: message authentication failed. Set up new storage and dug through the forums and nothing worked. I’m using backblaze and I cannot simply rename a folder I made a copy of contents to a new folder and apparently that broke it or … something else.

What exactly have you done and how did you setup new storage? What folder did you copy and where?

Explain in details please. It makes no sense. Backblaze does not have a concept of folders.

Do you use WebUI or CLI? Do you want to actually rename stuff on target or change the backup name in the UI?

Please explain what are you trying to do.

Thanks for the quick reply.

On backblaze, inside of snapshots folder I went to old id folder, downloaded all snapshot files
I created a new folder with the new id name
I uploaded the snapshot files I downloaded from the old id folder.
I validated the sha1 values between several of the files between old id folder and new id folder and they matched exactly.
I deleted storage and backups from web ui
I created new storage and new backup the same as they were created before with the only difference being the id of the backup
I tried to run the backup and got that cipher error referencing new_id_folder/187

to verify I’m not a simp and had the wrong password I went to another computer that’s never had any duplicacy set up on it and installed it, configured storage, and attempted a restore with old_id, no issue – so I know the encryption password is correct.

As for what I’m trying to do – accomplish the original ask in this thread “change backup id” via your instructions.

Really appreciate you having a look.

The old “folder” is still present on B2, right?

It looks the switcharoo worked correctly, it’s now referencing new folder, but revision 187 somehow got corrupted? What if you delete it? Does it proceeed? Can you download both 187 from old folder, and new folder, and binary compare them?

yes the old folder is still there. I deleted 187, and then 186 and then 185 and kept getting the same issue. I uploaded screenshots of the files, binary is same.

md5

Interesting. Not sure what’s going on. Could it be that path is part of the hash?

I will try to review the code in the evening.

1 Like

I did not see anything relevant in the code.

So I tried to backup some test files to local folder, rename the snapshot, and backup again, and it worked as expected:

/tmp % mkdir 1 2

/tmp % echo 2 > 2/file.txt

/tmp % cd 2

/tmp/2 % duplicacy init -storage-name test test-snapshot-1 /tmp/1
/tmp/2 will be backed up to /tmp/1 with id test-snapshot-1

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

/tmp/2 % find /tmp/1/snapshots -type f
/tmp/1/snapshots/test-snapshot-1/1

/tmp/2 % mv /tmp/1/snapshots/test-snapshot-1 /tmp/1/snapshots/test-snapshot-2

/tmp/2 % find /tmp/1/snapshots -type f
/tmp/1//snapshots/test-snapshot-2/1

/tmp/2 % cat .duplicacy/preferences | grep id
        "id": "test-snapshot-1",

/tmp/2 % sed -i '' 's/test-snapshot-1/test-snapshot-2/g' .duplicacy/preferences

/tmp/2 % cat .duplicacy/preferences | grep id
        "id": "test-snapshot-2",

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


/tmp/2 % find /tmp/1/snapshots -type f
/tmp/1/snapshots/test-snapshot-2/1
/tmp/1/snapshots/test-snapshot-2/2

/tmp/2 % duplicacy list
Storage set to /tmp/1
Snapshot test-snapshot-2 revision 1 created at 2024-03-29 10:45 -hash
Snapshot test-snapshot-2 revision 2 created at 2024-03-29 10:47

I’m not sure why does not it work for you with B2.

Edit. Ah dangit. Indeed, when the storage is encrypted, this does not work:

test.sh

mkdir 1 2
echo 2 > 2/file.txt
cd 2


duplicacy init -e -storage-name test test-snapshot-1 /tmp/1
duplicacy backup
find /tmp/1/snapshots -type f
mv /tmp/1/snapshots/test-snapshot-1 /tmp/1/snapshots/test-snapshot-2
find /tmp/1/snapshots -type f
cat .duplicacy/preferences | grep id
sed -i '' 's/test-snapshot-1/test-snapshot-2/g' .duplicacy/preferences
cat .duplicacy/preferences | grep id
echo 3 > 3.txt
duplicacy backup
find /tmp/1/snapshots -type f
duplicacy list
% zsh test.sh
Enter storage password for /tmp/1:********
Re-enter storage password:********
/tmp/2 will be backed up to /tmp/1 with id test-snapshot-1
Storage set to /tmp/1
Enter storage password:********
No previous backup found
Indexing /tmp/2
Parsing filter file /tmp/2/.duplicacy/filters
Loaded 0 include/exclude pattern(s)
Packed file.txt (2)
Backup for /tmp/2 at revision 1 completed
/tmp/1/snapshots/test-snapshot-1/1
/tmp/1/snapshots/test-snapshot-2/1
        "id": "test-snapshot-1",
        "id": "test-snapshot-2",
Storage set to /tmp/1
Failed to decrypt the file snapshots/test-snapshot-2/1: cipher: message authentication failed
/tmp/1/snapshots/test-snapshot-2/1
Storage set to /tmp/1
Failed to decrypt the file snapshots/test-snapshot-2/1: cipher: message authentication failed

Looks like snapshot.ID is part of the Snapshot structure, and becomes part of the hash, FWIW

1 Like

Thanks for the clarification and investigation. Bummer – but at least now I know. Is this a feature request we could submit for future? A process / feature to change backup IDs?

I’ve recategorized the topic to “Feature”

1 Like