How to copy between two B2 accounts? (or accounts that need environment variables)

I am talking about variables like B2_ACCOUNT_ID and B2_ACCOUNT_KEY. I tried B2_ACCOUNT_ID2 but it doesn’t work.

Thanks.

Sorry, not supported, see the blue note at Working with repositories — restic 0.12.1 documentation .

It was reasoned that it was better to have a copy feature that supported most use cases than to not have any copying at all because it didn’t support all use cases.

I swear I read that page 3 times and I missed the blue section. Thanks.

1 Like

Can copy also be used to migrate backups to some other destination?

e.g. I am backing up to b2 bucket and after some time (and hence some snapshops) I simply want to start backing up to a Scaleway bucket and want to have all the history of backup (i.e. snapshots etc).

How can I do it?

Sure, but if you just want to make a copy of your repository then you can just rclone or whatever it instead, no need to use copy. Or you just start running a second backup job instead, so you don’t happen to sync potential corruption over at B2 into your other repository as well.

Two related questions:

  1. Is there any difference between using B2 directly and using B2 via rclone? I assume they both use rclone serve restic in the backend.
  2. Is restic copy safe against corruption? (i.e. it doesn’t propagate the corruption to another repo), should I do restic check before or after on the source or destination?

restic copy checks all data it copies, so it won’t transfer a damage from one repository to the other. Running restic check from time to time can help with detecting data corruption for example due to hardware problems.

The builtin B2 backend is different from using B2 via rclone. The former backend is directly built into restic and avoids the indirection of rclone. Besides that they should provide similar functionality. That is you could copy from the built-in B2 backend to a rclone B2 backend.