Copying snapshots between S3 repositories

Within the recent past I was successful with using init, --repo2 and --copy-chunker-params (as presented in the documentation) for the two scenarios:

a) Between a local repo and a S3 repo
b) Between a REST server repo and a S3 repo.

I was then able to copy snapshots between those paired repos in both cases.

But now I want to use a different scenario and setup S3 backend to S3 backend where these S3 services use different credentials. Unless I’m mistaken, the restic command syntax does not appear to allow for this because AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY can only be used for one S3 repo but not the other. I would think this should be simple unless I’m misunderstanding something fairly basic.

I really hope that I won’t have to use something like “rclone sync” to try to sync both repo buckets across the different S3 services.

Any thoughts?


You could use the s3 backend in rclone as copy source and then use the native s3 backend in restic to upload to the target.

That is, something like restic -r rclone:s3-remote:bucket copy --repo2 s3:target. You’ll probably have to configure a S3 remote in rclone for that (Amazon S3).

These two environment variables are used for all S3 backends. That problem cannot be fixed in restic alone without introducing some additional means to configure the backends.

Thank you for your help.

I suspected that restic would have to be used with rclone in the way that you suggested. It’s probably the only solution that makes sense given that two S3 repos are being accessed together. It would mean having both utilities installed on the same system. I think you are correct…the two environment variables with respect to restic are used for all S3 backends.

Would it be worth it to make a feature request so that restic can use multiple S3 backends via multiple sets of environment variables?


That will probably just result in a huge mess. The only clean way forward would be support for a config files in which you can configure the backends, see Configuration File · Issue #16 · restic/restic · GitHub .