Transfer DigitalOcean Spaces Buckets Between Regions Using Rclone
Validated on 10 Sep 2020 • Last edited on 12 Dec 2025
Spaces Object Storage is an S3-compatible service for storing and serving large amounts of data. The built-in Spaces CDN minimizes page load times, improves performance, and reduces bandwidth and infrastructure costs.
To transfer DigitalOcean Spaces between regions, you need to use a file management tool to copy files from the original bucket to a second bucket in the target region.
This guide explains how to migrate data between Spaces regions by using Rclone to transfer data between two Spaces buckets, including how to install Rclone, the configuration settings needed to access multiple regions, and the commands that you can use to synchronize your files between regions and verify their integrity.
Prerequisites
Before we begin installing and configuring Rclone to copy our objects between buckets, we will need some information about our DigitalOcean Spaces account. We will need a Spaces API key, and we will need to know the regions and names of our source and destination buckets.
Generating a DigitalOcean Spaces API Key
To create a DigitalOcean Spaces API key, follow the instructions in Manage Access to Spaces documentation.
Save the access key ID and the secret key. We will use them later to configure Rclone to access our account.
Finding the Spaces S3-Compatible Endpoint
Next, we need to find the endpoint for each bucket. You can view the bucket’s endpoint within the DigitalOcean Control Panel by selecting the bucket and viewing the Settings tab:
The endpoint will always be the region you created the bucket in, followed by .digitaloceanspaces.com. Make note of the endpoint for both of your buckets. Will we use this information when creating our rclone configuration.
Note
Rclone may transfer objects using either CopyObject or a GetObject to PutObject workflow. When both buckets use the same remote and the same storage class, Rclone may perform a server-side copy.
When buckets are in different regions, different remotes, or different storage tiers (Standard Storage versus Cold Storage), Rclone downloads each object from the source (GetObject) and uploads it to the destination (PutObject).
Step 1: Installing Rclone
You’re now ready to install Rclone. You can do this on your local machine, or – if you are bandwidth limited – you may want to install Rclone on a Droplet located in the source or destination Spaces region.
Visit the Downloads section of the project’s website to find binaries of the utility compiled for different platforms. Download the zipped binary that matches your computer’s operating system to get started.
Once you have the Rclone zip file downloaded to your computer, follow the section below that matches your platform.
Before we can extract the archive, we will need to ensure that the unzip utility is available.
If you are running Ubuntu or Debian, you can update the local package index and install unzip by typing:
sudo apt update
sudo apt install unzip
If you are running CentOS or Fedora, you can install unzip by typing:
sudo yum install unzip
With unzip installed, navigate to the directory where you downloaded the rclone zip file:
cd ~/Downloads
Next, unzip the archive and move into the newly created directory:
unzip rclone*
cd rclone-v*
From here, we can copy the binary to the /usr/local/bin directory so that it is available system-wide:
sudo cp rclone /usr/local/bin
Next, we add the manual page to our system, so that we can get help on the command syntax and available options. Make sure that the local manual directory is available and then copy the rclone.1 file:
This will open up your text editor with a new blank file. Skip ahead to the section on Configuring Rclone to continue.
If you are running Windows, begin by navigating to the Downloads directory in the Windows File Explorer. Select the rclone zip file and right-click. In the context menu that appears, click Extract All…:
Follow the prompts to extract the files from the zip archive.
The rclone.exe utility must be run from the command line. Open a new Command Prompt (the cmd.exe program) window by clicking the Windows button in the lower-left corner, typing cmd, and selecting Command Prompt.
Inside, navigate to the rclone path you extracted by typing:
cd"%HOMEPATH%\Downloads\rclone*\rclone*"
List the directory contents to verify that you are in the correct location:
You will need to be in this directory whenever you want to use the rclone.exe command.
Note: On macOS and Linux, we run the tool by typing rclone, but on Windows, the command is called rclone.exe. Throughout the rest of this guide, we will be providing commands as rclone, so be sure to substitute rclone.exe each time when running on Windows.
Next, we can create the configuration directory and open up a configuration file to define our S3 and Spaces credentials:
This will open up your text editor with a new blank file. Continue ahead to learn how to define your Spaces regions in the configuration file.
Step 2: Configuring Rclone
We will configure our two DigitalOcean Spaces regions as Rclone “remotes” in the Rclone configuration file. Paste the following section in ~/.config/rclone/rclone.conf to define the first region:
Here, we define a new rclone “remote” named spaces-sfo2. Change the region name to match the Spaces region you are configuring.
We set the type to s3 and provider to DigitalOcean so that rclone knows the appropriate way to interact with and manage the remote storage resource. We will define the Spaces access credentials in this configuration file, so we can set env_auth to false.
Next, we set the access_key_id and secret_access_key variables to our Spaces access key and secret key, respectively. Be sure to change the values to the credentials associated with your account.
We set the endpoint to the bucket endpoint we looked up earlier.
Finally, we set the acl to private to protect our assets until we want to share them.
Next, make a duplicate of the configuration block you created, then update the name and endpoint region inside ~/.config/rclone/rclone.conf to reflect your second region:
The rest of the configuration should remain the same as for the first region. Save and close the file when you are finished.
On macOS and Linux, be sure to lock down the permissions of the configuration file since our credentials are inside:
chmod 600 ~/.config/rclone/rclone.conf
On Windows, permissions are denied to non-administrative users unless explicitly granted, so we shouldn’t need to adjust access manually.
Next, we’ll use rclone to explore our buckets and sync data between them.
Using Rclone with Cold Storage Buckets
When transferring data to or from Cold Storage buckets, Rclone cannot use CopyObject. Cold Storage does not support server-side copies across regions or between Standard and Cold Storage buckets. As a result, Rclone must download each object from the source bucket (GetObject), and then upload it to the destination bucket (PutObject).
To ensure Rclone performs this correctly, add the --disable copy flag to any rclone sync or rclone copy command. This forces Rclone to avoid attempting CopyObject operations, which would otherwise fail when Cold Storage is involved.
For Cold Storage transfers, use rclone sync or rclone copy with two properly configured remotes. Rclone handles the download-and-upload process automatically, including when transferring between regions.
Step 3: Copying Objects from S3 to Spaces
Now that our configuration is complete, we are ready to transfer our files.
We can view the available buckets by asking rclone to list the “directories” associated with the remotes (make sure to add the colon to the end of the remote name):
To view the contents of a bucket, you can use the tree command. Pass in the remote name, followed by a colon and the name of the “directory” you wish to list (the bucket name):
Assuming everything went well, rclone will begin copying objects between the two buckets.
Note: If you hadn’t previously created the destination bucket in the specified region, rclone will attempt to create one for you with the given name. This will fail if the name provided is already being used by another account or if the name doesn’t meet the naming requirements for DigitalOcean Spaces (lowercase letters, numbers, and dashes only).
When the transfer is complete, you can check that the objects have transferred by viewing them with the tree subcommand:
This will compare the hash values of each object in both remotes. You may receive a message indicating that some hashes could not be compared. In that case, you can rerun the command with the --size-only flag (which compares based on file size) or the --download flag (which downloads each object from both remotes to compare locally) to verify the transfer integrity.
Summary
In this guide, we’ve covered how to transfer objects between two DigitalOcean Spaces regions. We gathered API credentials and endpoint information from the Spaces service, installed and configured the rclone utility on our local computer, and then copied all objects from a source bucket to a destination bucket.
What’s Next?
The rclone client can be used for many other object storage management tasks including uploading or downloading files, mounting buckets on the local filesystem, and creating or deleting additional buckets. Check out the man page to learn more about the functionality the tool provides.
We can't find any results for your search.
Try using different keywords or simplifying your search terms.