Change google drive repo

Hi,

I would like to migrate my backup repo from one google drive to another google drive.
I have already copy the restic repo from google drive #1 to google drive #2.
But when I edit my --repository-file to reflect the new google drive (rclone:gdrive1:Backup/Restic/ → rclone:gdrive2:Backup/Restic/), I get an error:

Fatal: parsing repository location failed: invalid backend
If the repo is in a local directory, you need to add a local: prefix

Could you please tell me how to fix it?
Thanks

can you run:

rclone lsd gdrive1:Backup/Restic

and

rclone lsd gdrive2:Backup/Restic

Yes of course:

rclone lsd gdrive1:Backup/Restic
          -1 2021-11-24 23:07:49        -1 VDT
          -1 2022-09-04 19:18:50        -1 VPSikoula
          -1 2021-03-24 14:47:11        -1 racine-rm-work-T470
          -1 2021-02-28 13:23:02        -1 rm-work-T470
rclone lsd gdrive2:Backup/Restic
          -1 2023-08-22 14:52:15        -1 VDT
          -1 2023-08-22 14:19:10        -1 VPSikoula
          -1 2023-08-22 14:19:09        -1 racine-rm-work-T470
          -1 2023-08-22 14:19:12        -1 rm-work-T470

There is no restic repo in neither gdrive1:Backup/Restic nor gdrive2:Backup/Restic so your error message states the fact.

Here you are example of remote with restic repo:

$ rclone lsd OD01-ENC:restic-vm
          -2 2023-09-03 10:08:52       182 data
          -2 2023-09-03 10:05:46         0 index
          -1 2023-08-14 19:03:14         1 keys
          -2 2023-09-03 10:08:28         0 locks
          -2 2023-09-03 10:08:28         1 snapshots

and then restic uses RESTIC_REPOSITORY="rclone:OD01-ENC:restic-vm"

Actually, that’s because there are several repos in Backup/Restic folder.
I get similar result as yours when I take one for example:

rclone lsd gdrive1:Backup/Restic/rm-work-T470
-1 2021-02-28 13:23:03 -1 data
-1 2021-02-28 13:23:04 -1 index
-1 2021-02-28 13:23:05 -1 keys
-1 2021-02-28 13:23:06 -1 locks
-1 2021-02-28 13:23:07 -1 snapshots

rclone lsd gdrive2:Backup/Restic/rm-work-T470
-1 2023-09-02 12:29:35 -1 data
-1 2023-08-22 14:47:37 -1 index
-1 2023-08-22 14:47:59 -1 keys
-1 2023-09-02 12:28:24 -1 snapshots

Ok please provide all info:

restic version

and exact restic command you run

restic version
restic 0.16.0 compiled with go1.20.6 on linux/amd64

sudo restic --repository-file /etc/restic/home --password-file /etc/restic/secret/home check --read-data-subset=2.5%
using temporary cache in /tmp/restic-check-cache-1404901381
Fatal: parsing repository location failed: invalid backend
If the repository is in a local directory, you need to add a local: prefix

cat /etc/restic/home
#rclone:gdrive1:Backup/Restic/rm-work-T470/
rclone:gdrive2:Backup/Restic/rm-work-T470/

OK

and now:

sudo rclone version

rclone v1.63.1

  • os/version: debian trixie/sid (64 bit)
  • os/kernel: 6.4.0-4-amd64 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.20.6
  • go/linking: static
  • go/tags: none

did you run it with sudo?

actually 99% I know what the issue is:

remove this line:

#rclone:gdrive1:Backup/Restic/rm-work-T470/

--repository-file file does not accept any comments

Yes I did run sudo rclone version.

I removed the commented line in repository-file, that’s indeed better, if not working yet:

sudo restic --repository-file /etc/restic/home --password-file /etc/restic/secret/home check --read-data-subset=2.5%
using temporary cache in /tmp/restic-check-cache-3352847845
rclone: 2023/09/04 13:49:25 Failed to create file system for “gdrive2:Backup/Restic/rm-work-T470/”: didn’t find section in config file
Fatal: unable to open repository at rclone:gdrive2:Backup/Restic/rm-work-T470/: error talking HTTP to rclone: exit status 1

I think it is self explanatory… you do not have gdrive2 remote defined

run:

sudo rclone listremotes

to see what is there and what is not

1 Like

Actually a gdrive2 remote was defined… but not for root/sudo user!
So I added the remote into /root/.config/rclone/rclone.conf
I need to wait for tomorrow to be able to test (because of userRateLimitExceeded), but now it should be alright.
Thanks kapitainsky for you kind help!

One could also add capabilities to the restic binary so you don’t have to run restic via sudo.
This is described here: Examples — restic 0.16.0 documentation