Move rclone config to another machine

What is the problem you are having with rclone?

I'm moving everything from one PC (cygwin on Win10) to a new machine (Ubuntu WSL2 on Win11). I'd like to move my rclone config from one machine to another. I've found and moved the rclone.conf file from my old machine to the correct location (~/.config/rclone) on my new machine. However, moving the .conf file does not allow me to use my existing remotes on the new machine.

Everything below is from the new machine with the rclone.conf copied over to it.

Run the command 'rclone version' and share the full output of the command.

rclone v1.50.2

  • os/arch: linux/amd64
  • go version: go1.13.8

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone sync --dry-run --verbose --create-empty-src-dirs personalgoogledrive:Personal //familynas/
Public/Backups/GoogleDrive/Personal --exclude="Google Photos/**"

The rclone config contents with secrets removed.

[personalgoogledrive]
type = drive
client_id = exit
client_secret = eq
token = {"access_token":"REMOVED","token_type":"Bearer","refresh_token":"REMOVED","expiry":"2022-08-22T22:15:36.6292993-07:00"}

I'm seeing the expiry date above and suspect that might be an issue, but also wondering if it can be updated/renewed.

A log from the command with the -vv flag

2022/10/10 18:31:15 DEBUG : rclone: Version "v1.50.2" starting with parameters ["rclone" "-vv"]
1 Like

Try rclone config reconnect personalgoogledrive: to get a new access token.

1 Like

Hi aagha,

Here is a few things that I would do/check before trying to update the access token:

  1. Update from the very old v1.50.2 to v.1.59.2. You can download it from here: Rclone downloads
  2. Check that rclone finds your config file correctly using rclone config show
  3. Check if you have basic access to you remote using rclone lsd personalgoogledrive:

If the last step fails also after refreshing the token, then please post the output from rclone lsd personalgoogledrive: -vv

@Ole I don't seem to be able to pull down a new version on Ubuntu:

I'll try to pull down a binary if I can't find another way to get the latest.

Will report back.

I got this error:

When trying rclone lsd personalgoogledrive:I got:

Will try to do the upgrade next.

Don’t use a package manager.

Follow this

Done:

Thanks.

@csparker247 @Ole

Followed your directions:

rclone config show seems to be pulling the right config:

I ran a rclone lsd personalgoogledrive: and got the following:

With the reconnect:

Should the URL be a local, 127.0.0.1 URL? One thought is that WSL2 is a sub-system, and so that URL might not be valid outside of the shell.

are you running wsl2 or wsl2g?

inside wls2g, should behave the same as a linux machine with a GUI.
works for me

Just wsl2, not wsl2g

i just took another look at your screenshot, looks like rclone opened a web browser,
is that correct?

fwiw, i would create a new gdrive remote from scratch.

No, a browser won't open. I have to go to that URL and then I end up getting that token not found message.

fwiw,
i would run rclone config using latest rclone, on any machine with a web browser.
then copy that rclone.conf to wsl

if you want to run rclone config from inside wsl2 to create a gdrive remote with oauth2 and web browser
there is a way to do that but a bit complicated.

user01@wsl01:~/rclone$ /mnt/c/data/rclone/rclone.exe version
rclone v1.58.1
- os/version: Microsoft Windows 11 Pro 21H2 (64 bit)
- os/kernel: 10.0.22000.1042 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.17.9
- go/linking: dynamic
- go/tags: cmount

user01@wsl01:~/rclone$ rclone version
rclone v1.59.2
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: 5.10.102.1-microsoft-standard-WSL2 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.18.6
- go/linking: static
- go/tags: none

user01@wsl01:~/rclone$ pwd
/home/user01/rclone
user01@wsl01:~/rclone$ /mnt/c/data/rclone/rclone.exe config --config=/home/user01/rclone/zork.conf
NOTICE: Config file "\\\\wsl.localhost\\Ubuntu-20.04\\home\\user01\\rclone\\zork.conf" not found - using defaults
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> zork
Storage> drive

### at this point, wsl will open a web browser on the windows host. in my case on windows, i run firefox ###

Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine

y) Yes (default)
n) No
y/n>
NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=sJcUpcQwLYMCf3pMwnryRA
NOTICE: Log in and authorize rclone for access
NOTICE: Waiting for code...
NOTICE: Got code
Configure this as a Shared Drive (Team Drive)?

y) Yes
n) No (default)
y/n>
--------------------
[zork]
type = drive
token = {"access_token": redacted}
team_drive =
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name                 Type
====                 ====
zork                 drive

user01@wsl01:~/rclone$ rclone lsd zork: --config=./zork.conf -vv
DEBUG : rclone: Version "v1.59.2" starting with parameters ["rclone" "lsd" "zork:" "--config=./zork.conf" "-vv"]
DEBUG : Creating backend with remote "zork:"
DEBUG : Using config file from "/home/user01/rclone/zork.conf"
          -1 2022-01-12 13:38:48        -1 zork

Am I selecting the wrong options here?

looks ok to me, that rclone opens a web browser.
not sure why you get that 401 - i would try a different web browser in a private window.

have you tried to create a new remote, instead of rclone config reconnect

That error means whatever you have typed into the client_id is wrong.

image

This is the only thing that's worked. Thanks.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.