Copy Data From One DigitalOcean Spaces to Another DigitalOcean Spaces

Introduction

DigitalOcean Spaces is a cloud-based object storage service that provides object storage through a web service interface and API. It allows you to store any amount of data at any time. In some cases, you will need to move or copy data from one storage provider to another. In this case, you can choose SnapShooter's S3 Sync service to copy your data from one S3 compatible storage to another.

SnapShooter offers an S3 Sync tool that allows you to copy, move or sync the data from one DigitalOcean Spaces to another DigitalOcean Spaces, a second location, region, or even provider. That means S3 Sync allows you to sync, duplicate and backups of S3-compatible data, or set up a schedule to keep 2 services in sync.

Manually copying data from one DigitalOcean Spaces to another bucket is a tough task. You will need to download the data to your local machine and re-uploading it to another DigitalOcean Spaces. That's a bit of a pain. In this case, you can use SnapShooter's S3 Sync service to sync data between services, allowing you to keep different buckets updated on a schedule.

In this guide, we will show you how to copy data from one DigitalOcean Space to another DigitalOcean Space using SnapShooter.

Create a DigitalOcean Spaces

First, you will need to create a second DigitalOcean Space to store the data copied from an existing DigitalOcean Space. Follow the below steps to create a bucket on AWS S3:

Step 1 - Sign in to your DigitalOcean account and click on the Spaces in the left pane.

Step 2 - Click on the Create => Space button. You should see the following screen:

Step 3 - Select your region, Restrict File Listing, Provide your unique space name and click on Create a Space button. Once the Space is created, you should see the following screen:

Create Your DigitalOcean Credentials

Next, you will need the correct access key and secret key to authenticate with DigitalOcean Spaces. Follow the below steps to create a DigitalOcean Credentials:

Step 1 - Log in to your DigitalOcean Spaces account.

Step 2 - Click on the Manage Keys button on the right-hand side of the Spaces screen.

Step 3 - Click on the Generate New Key next to Spaces access keys. Provide a name for your key and click the checkmark. A new Key and Secret will be generated as shown below:

Add a Server to Snapshooter

You will also need to add a server to the SnapShooter for the transmission of data to happen over. Follow the below steps to add a server to Snapshooter:

Step 1 - First, go to the SnapShooter website and register for their 14-day free trial.

Step 2 - On the SnapShooter dashboard, click on the Servers in the left sidebar. You should see the following screen:

Step 3 - Click on the Connect Server. You should see the following screen:

Step 4 - Copy and paste the code shown in the above image to your server:

curl -sSL "https://ingestor.snapshooter.com/api/server/add?token=eyJpdiI6IjFIbUJqUHlWMTd3cVFmYjBnZHRGVEE9PSIsInZhbHVlIjoiYWp2VCtmUkVvamNTWktEUnhaaVVrZz09IiwibWFjIjoiYzEyZDQ4NjY1YTA3ZGFkMGMwZDJkMjUyMjk3ZGNlNjNiYmIxODI4YTA5ZDc5NzIwMTA0NTZmZjJmODBkOGJkMyIsInRhZyI6IiJ9&key=6773" | bash

Once your server is connected to the Snapshooter, you will get the following output:

Welcome to SnapShooter Server Setup
Environment Detected: OS: linux, OS Type: amd64
Installing SSH public key
Creating temp SSH key file
grep: /root/.ssh/authorized_keys: No such file or directory
cp: cannot stat '/root/.ssh/authorized_keys': No such file or directory
Creating authorized_keys backup /root/.ssh/authorized_keys.bak-1653474994
Key Installed /root/.ssh/authorized_keys
Removing temp SSH key file
Scanning SSH config
Checking 22
matched (22)
SSH test confirmed, Server Added to SnapShooter ...

Step 5 - Go back to your web browser, you should see your added server on the following screen:

Attache Both DigitalOcean Spaces to Snapshooter

Next, you will need to attach both source and destination DigitalOcean Spaces to the SnapShooter.

Click here to attach the source DigitalOcean Spaces to the SnapShooter You should see the following screen:

Choose a Friendly Name, Select DigitalOcean Spaces, select region, type your access key and secret access key, type your DigitalOcean Spaces name, and press the Attach External Storage button.

Again click here to attach the destination DigitalOcean Spaces to the SnapShooter You should see the following screen:

Choose a Friendly Name, Select DigitalOcean Spaces, select region, type your access key and secret access key, type your DigitalOcean Spaces name, and press the Attach External Storage button.

Create a Backup Job to Copy the Content of One DigitalOcean Space to Another DigitalOcean Space

Now, you will need to create a backup job to copy data from one DigitalOcean Space to another DigitalOcean Space at a specific interval of time. Follow the below steps to create a backup job:

Step 1 - On the SnapShooter dashboard, click on the Backup Jobs in the left pane. You should see the following screen:

Step 2 - Click on the Create Backup Jobs. You should see the following screen:

Step 3 - Click on the S3 Sync, you should see the following screen:

Step 4 - Provide your backup job name and click on the Continue button. You should see the following screen:

Step 5 - Select your server and click on the Next button. You should see the following screen:

Step 6 - Define the directory path in the destination bucket, select your source DigitalOcean Spaces and click on the Test button. You should see the following screen:

Step 7 - Click on the Save and Next button. You should see the following screen:

Step 8 - Select your destination DigitalOcean Spaces and click on the Set Storage button. You should see the following screen:

Step 9 - Define your backup schedule and click on the Set Schedule and Finish button. You should see the following screen:

Step 10 - Click on the Backup Now button to start copying data from one DigitalOcean Space to another DigitalOcean Space. Once the backup process is completed successfully, you should see the following screen:

You can also verify your DigitalOcean Spaces data by accessing the second DigitalOcean Spaces. You should see your all data on the following screen:

Conclusion

In this guide, you learned how to copy data from one DigitalOcean Space to another DigitalOcean Space using SnapShooter. If you accidentally delete a file from your source bucket. Not a problem, SnapShooter has an automatic restore function to allow you to restore files from your destination.

SnapShooter support many S3 providers on the marketplace, including AWS S3, DigitalOcean Spaces, Backblaze, Upcloud, Scaleway, Minio, and custom endpoints. If you have object storage missing let us know we are happy to add any. We believe everyone should keep a copy of their data offsite and secure.


Was this page helpful?

Thank you for helping us improve!