• Jon T
    My use case: a major disaster causes me to lose the house (local backups gone) and also the bank vault in my city containing my rotated backup-of-my-backup external disk drives. I need to restore all my buckets from B2 (each machine on my LAN (a Windows Server and 2 PCs) does CloudBerry file backups to its own bucket). But rather than restore 500GB of total data from the cloud, I can create snapshots of my buckets and BackBlaze will ship me a USB hard drive with these snapshots (one snapshot per bucket). The snapshot is a copy of all the files contained in the bucket. I want to copy the snapshots to a local disk, then I want to use CloudBerry to restore the files from the snapshots because I've encrypted the files when i originally backed them up.

    To summarize: each bucket is a CloudBerry backup destination. I can move a copy of that bucket to a local drive. I want to restore from that local drive using CloudBerry.

    Here's my question: I've run a few toy backup / snapshot / restore cycles. I'm able to create a restore plan with a file system account (the account points to the root directory of one of the snapshots) and it's set as "restore only" (since there's no repository--in a disaster situation I may be restoring the files to a computer different than the one that did the original backup).

    In the restore plan, I can enter my decryption password and request the most recent copy of each file. The restore runs, and the files are decrypted fine, but the restore mirrors the backup directory tree instead of the original tree as backed up.


    As backed up:
    H:\Server Folders\Playlists\Jazz.m3u

    What I get after the restore runs (here, I've directed the restore to D:\restore\):
    D:\restore\H_\Server Folders\Playlists\Jazz.m3u_\20170203171341\Jazz.m3u

    The file is decrypted fine, (note I'm not encrypting file names, just the contents), but each file is now an additional 2 directories deep (mirroring the CloudBerry housekeeping directories). Ugh! In my use case, having to pull out every decrypted file from this structure would be impractical.

    Has anyone tried this? Am I not setting something I should be in the restore plan?


    Jon T.
  • Vlad L
    Hello Jon,

    The folder structure is slightly different when backing up to local destination and to cloud we use different delimiters. For cloud storages it's : (colon). For example

    \CBB-prefix\H:\Server Folders\Playlists\Jazz.m3u:\20170203171341\Jazz.m3u

    However in case of local destination we use $ sign since colon isn't supported in Windows in names of files and folders:
    \CBB-prefix\H$\Server Folders\Playlists\Jazz.m3u$\20170203171341\Jazz.m3u

    In order to restore your data you would need to rename all those symbols to $ signs. While disk names you can rename manually, renaming folder for every file is very time consuming.
    However you can rename all your folders using the following powershell script:

    Get-ChildItem -Recurse | Rename-Item -NewName {$_.Name -Replace "_$",'$'}
    Get-ChildItem -Recurse | Rename-Item -NewName {$_.Name -Replace "_acl",'$acl'}

    Create txt file and paste two lines above. Save it and change extension to .ps1

    You will need to place this file to CBB_prefix folder (where prefix is the name of your machine) and then launch it. It will rename all folders inside and you will be able to restore files properly.

    Please try to test it on small backup and check if that works for you.
  • Jon T
    Hi Vlad,

    This is excellent. And thanks for the quick reply. When I use BackBlaze's web client to look at my backup data in the bucket, I see the trailing colons. It looks like BackBlaze converts these to underscores when it creates the snapshot.

    I ran two tests:

    1) My toy snapshot was small enough for me to manually replace trailing underscores with dollar signs as a proof of concept. With some trial and error, I noticed the drive letter directory in my snapshot had two trailing underscores which both needed to be replaced with a single dollar sign for the restore to work (i.e. 'H__' to 'H$'). The restore worked as expected (The directory tree was what I expected, and all the files at the leaves were decrypted).

    2) I tried your Powershell script on a fresh copy of the snapshot. I added an additional line at the top to deal with the double underscore suffix of the drive letter directory as follows:

    Get-ChildItem -Recurse | Rename-Item -NewName {$_.Name -Replace "__$",'$'}
    Get-ChildItem -Recurse | Rename-Item -NewName {$_.Name -Replace "_$",'$'}
    Get-ChildItem -Recurse | Rename-Item -NewName {$_.Name -Replace "_acl",'$acl'}

    The script worked great, and I was able to successfully run a restore job against the modified snapshot with the results I expected.

    Woo Hoo! Thanks again. Knowing I can do this gives me more restore options if that disaster ever strikes.

    Jon T.

    P.S. This might make a good knowledge base article (if it isn't already) since I'm sure I won't be the only B2 user to want to try this.
  • Vlad L
    Hello Jon,
    Glad to hear it works for you!

    In the future we are planning to implement some improvements on this matter, there will be single delimiter type for both local and cloud backup.
    But meanwhile in case of disaster that powershell script should save the day.

    Best Regards,

  • Chris Ruffin
    This behavior doesn't support the use case to use the azure data box disk service or similar service to seed the offsite half of a a hybrid backup job. I attempted to seed an azure storage account as follows: 1) do local backup of files/folders to local NAS. 2) copy the data to the azure data box disk and have the data copied to azure storage account. 3) create a new hybrid backup job to sync the same data to local NAS and also to azure storage account 4) sync repository. 5) Run the new hybrid job. But I noted that cloudberry will not recognize the seeded data. Instead there will now be two copies of the data in the azure storage account, one with directory H$, and one with H:.
  • Matt
    That's the problem Vlad mentioned: local backups are stored with "$" character, so you would need to rename those to ":" in the cloud and synchronize the repository in our software.
Add a Comment