Hi, I’ve been tasked with migrating files from Google Cloud Storage to AWS S3. As part of the migration, we need to capture the S3 URLs of the files (so we can update our database with the new S3 paths instead of the old GCS ones). Ideally, as each file is migrated, its S3 URL should be written to a log file that we can later process to update the database.
From my research, it seems there isn’t a built-in way in rclone to output the destination URL directly. ChatGPT suggested using --use-json-log with --log-file=mapping.json and then parsing the output with a Python script, but I’m wondering if there’s a more standard or efficient way to achieve this.
This feels like a common migration scenario, so I’d expect there to be some best practice around it. What’s the recommended way to use rclone to accomplish this?
Run the command 'rclone version' and share the full output of the command.
Which cloud storage system are you using? (eg Google Drive)
Google Cloud Storage and about to migrate to S3 AWS.
The command you were trying to run (eg rclone copy /tmp remote:tmp)
Why you want to capture something which is always there in plain site? Unless you use some custom URL mappings (but then rclone wont help you anyway) your S3 URL corresponds to file location “base URL/bucket/path/filename”.
But rclone ls only returns the file size and name (e.g. 554944 image.png), not the full S3 URL as you suggested “base URL/bucket/path/filename”.
Is there a way to have rclone output the full S3 URL directly using commands or flags, or do I need to construct the URLs based on the filename, the bucket, and the base URL after migration?
where test-uk and kopia-lock are two different buckets I am using.
Anyway. rclone ls might be not the best option. rclone lsf is more flexible.
Bottom line is - all information you need is available IMO. No need to plan capturing anything from logs. As you will not find there anything extra anyway.
Oh nice, I ran rclone ls on my local machine (not on S3 yet), so it returns output like 554944 image.png. Just to confirm—are the strings like 0defa7875a071b7 at the end of each line in your output the file name or the folder name? If running rclone ls returns both bucket name and file name then it satisfies my goal.