Hi Gchen,
yes, through hubic website, I can see there are two folders in music/snapshots, 0 & 1:
hubiC/Duplicacy/oDroid/music/snapshots/0 --> two files, called 1 & 2.
hubiC/Duplicacy/oDroid/music/snapshots/1 --> one file, called 1.
in OpenDrive/music/snapshots/0 --> two files, called 1 & 2.
I have performed many tests and when the naming is different, I cannot restore from Secondary.
Well, If we check carefully the official documentation, it is using “my-backups” as respository_id on both respotories (Back up to multiple storages):
If you’re backing up to two cloud storage providers, issuing a copy command will cause all data to be downloaded from one cloud storage, and uploaded to the other. This can be slow, and may incur extra download costs. To avoid this - while maintaining duplicate backups - you can issue a “fake” backup to the destination cloud storage which will hopefully have many duplicate chunks with the “real” backup. The copy operation after will then copy the minimal amount from the source cloud storage.
duplicacy init my-backups --storage-name backblaze b2://bucket
duplicacy add -copy backblaze wasabi my-backups wasabi://bucket
duplicacy add wasabi-temp my-backups-temp wasabi://bucket
duplicacy backup -storage backblaze
duplicacy backup -storage wasabi-temp
duplicacy copy -from backblaze -to wasabi
Sorry to extend this threath a bit, but here there is an example with different naming (0 and 1 as respository_id) with no luck restoring.
initialized storage and preparations
# duplicacy init -e -storage-name openDrive_rclone 0 /mnt/OpenDrive/Duplicacy/Odroid/music
# duplicacy add -e -copy openDrive_rclone hubic 1 hubic://Duplicacy/oDroid/music
# duplicacy set -key hubic_token -storage hubic -value /tmp/hubic-token.json
# duplicacy set -key hubic_password -storage hubic -value "XXXXX"
# duplicacy set -key password -storage openDrive_rclone -value "XYXYXY"
Following documentation, started an initial backup on both repositories
# duplicacy backup -stats -threads 10
# duplicacy backup -stats -storage hubic -threads 10
Copy a new file
# cp ../01-Mr.Brightside.mp3 .
# ls
01-Mr.Brightside.mp3 11 - Everything Will Be Alright.mp3
backup on Primary only
# duplicacy backup -stats -threads 10
Storage set to /mnt/OpenDrive/Duplicacy/Odroid/music/
Last backup at revision 1 found
Indexing /data/Downloads/duplicacy_test/Music
Use 10 uploading threads
Uploaded chunk 3 size 2137571, 209KB/s 00:00:32 23.9%
Uploaded chunk 2 size 3259582, 240KB/s 00:00:15 60.3%
Uploaded chunk 1 size 3539299, 323KB/s 00:00:01 100.0%
Uploaded 01-Mr.Brightside.mp3 (8936452)
Backup for /data/Downloads/duplicacy_test/Music at revision 2 completed
Files: 2 total, 16,807K bytes; 1 new, 8,727K bytes
File chunks: 6 total, 16,807K bytes; 3 new, 8,727K bytes, 8,754K bytes uploaded
Metadata chunks: 3 total, 967 bytes; 3 new, 967 bytes, 1K bytes uploaded
All chunks: 9 total, 16,807K bytes; 6 new, 8,727K bytes, 8,755K bytes uploaded
Total running time: 00:00:57
Copied from Primary to Secondary without running backup on secondary (to test the copy as per the documentation)
# duplicacy copy -from openDrive_rclone -to hubic -threads 10
Source storage set to /mnt/OpenDrive/Duplicacy/Odroid/music/
Destination storage set to hubic://Duplicacy/oDroid/music/
Chunk 239e584b27a168b16f6bd2c8f45 (2/12) skipped at the destination
Chunk b48131ac50b47ab918b9a447412 (3/12) skipped at the destination
Chunk cf6d5762507976675ff93cdfe3d (4/12) skipped at the destination
Chunk 43fc0eb96e65e1f1de635f022eb (8/12) skipped at the destination
Chunk 4b7d350267d44fcbe22ed9b66eb (9/12) skipped at the destination
Chunk 2a5fc079907fe6211ef15972552 (10/12) skipped at the destination
Chunk a26620d76a17ae18bad4cc890bd (11/12) copied to the destination
Chunk 8bf6f59782a00564d9f46a2aaa9 (6/12) copied to the destination
Chunk f9f73ef6318aadba0d0aacc6229 (7/12) copied to the destination
Chunk 026dffc51abf55f776745aec3f5 (12/12) copied to the destination
Chunk c2faca6714dbbc0981e703ee36d (5/12) copied to the destination
Chunk dfb8a6fd4ed9c175a8b39372b58 (1/12) copied to the destination
Copy complete, 12 total chunks, 6 chunks copied, 6 skipped
Copied snapshot 0 at revision 1
Copied snapshot 0 at revision 2
List the primary storage :
# duplicacy list -a -storage openDrive_rclone
Storage set to /mnt/OpenDrive/Duplicacy/Odroid/music/
Snapshot 0 revision 1 created at 2018-03-25 22:20 -hash
Snapshot 0 revision 2 created at 2018-03-25 22:27
List the secondary storage: Note, there is revision 1 only that belongs to the initial backup and revision 2 that belongs to the copy execution while in the webpage, I can see a folder named 0 inside snapshots in OpenDrive with two files. And two folders inside snapshots named 0 (with 2 files) and 1 (with 1 file) in Hubic.
# duplicacy list -a -storage hubic
Storage set to hubic://Duplicacy/oDroid/music/
Snapshot 0 revision 1 created at 2018-03-25 22:20 -hash
Snapshot 0 revision 2 created at 2018-03-25 22:27
Snapshot 0 revision 1 created at 2018-03-25 22:20 -hash
Snapshot 0 revision 2 created at 2018-03-25 22:27
Snapshot 1 revision 1 created at 2018-03-25 22:23 -hash
Snapshot 1 revision 1 created at 2018-03-25 22:23 -hash
Removed a file
# ls
01-Mr.Brightside.mp3 11 - Everything Will Be Alright.mp3
# rm 01-Mr.Brightside.mp3
try to restore it from secondary at revision 1 (nothing is restore as this file was not on the initial backup, it only exists on revision 2):
# duplicacy restore -r 1 -stats -storage hubic -- *Brightside*
Storage set to hubic://Duplicacy/oDroid/music/
Restoring /data/Downloads/duplicacy_test/Music to revision 1
Restored /data/Downloads/duplicacy_test/Music to revision 1
Files: 0 total, 0 bytes
Downloaded 0 file, 0 bytes, 0 chunks
Total running time: 00:00:05
Restore from Primary (same, as the file does not exist on revision 1 but 2)
# duplicacy restore -r 1 -stats -- *Brightside*
Storage set to /mnt/OpenDrive/Duplicacy/Odroid/music/
Restoring /data/Downloads/duplicacy_test/Music to revision 1
Restored /data/Downloads/duplicacy_test/Music to revision 1
Files: 0 total, 0 bytes
Downloaded 0 file, 0 bytes, 0 chunks
Total running time: 00:00:06
No file is restored:
# ls
11 - Everything Will Be Alright.mp3
As stated before, this new file only exists on revision 2, hence, try to restore from revision 2.
But… Revision 2 on Secondary does not exist
# duplicacy restore -r 2 -stats -storage hubic -- *Brightside*
Storage set to hubic://Duplicacy/oDroid/music/
Snapshot 1 at revision 2 does not exist
Revision 2 on Primary - Restored, but again from Primary only…
# duplicacy restore -r 2 -stats -- *Brightside*
Storage set to /mnt/OpenDrive/Duplicacy/Odroid/music/
Restoring /data/Downloads/duplicacy_test/Music to revision 2
Downloaded chunk 1 size 3539299, 1.13MB/s 00:00:05 39.6%
Downloaded chunk 2 size 3259582, 1.08MB/s 00:00:02 76.0%
Downloaded chunk 3 size 2137571, 1.07MB/s 00:00:01 100.0%
Downloaded 01-Mr.Brightside.mp3 (8936452)
Restored /data/Downloads/duplicacy_test/Music to revision 2
Files: 1 total, 8.52M bytes
Downloaded 1 file, 8.52M bytes, 3 chunks
Total running time: 00:00:11
At this point I understood the naming has to be the same in both respositories (or at least, everything points in that direction).
I can perform any test as required.