Thoughts, stories and ideas for web developers (with a focus on WordPress)

I’m a huge fan of Digital Ocean and love using their products. I’m also very paranoid when it comes to backing up data. Since I’m using Digital Ocean for the delivery of web assets for multiple websites, this data is very crucial and losing the files would be disastrous. It’s clear that I need to have backups of my Digital Ocean Spaces and you should too.

My files are safe in Digital Ocean Spaces, right?

When you’re using a cloud storage service like Digital Ocean Spaces, you rely on Digital Ocean that your files are safe. The thing is, relying on third parties is always a bad thing, you should only rely on yourself. The opposite is true as well, you can’t trust yourself that you will not mess things up. Imagine that you write a script with a fatal error (I know you don’t make errors, but just imagine) that actually deletes files from your Digital Oceans Spaces container. No problem right, just have to get the back-ups from Digital Ocea..oh, they don’t exist. Digital Ocean doesn’t back-up your Digital Ocean Spaces, they trust that you know your way around cloud computing and that you have your own back-ups. I even read a Reddit post about someone who lost all his data while using Digital Ocean Spaces, so these things happen and you should prepare for it.

Since Digital Ocean Spaces uses the S3-protocol, it’s luckily quite easy to set up your own back-up.

Goodsync

If you’re familiar with writing scripts, you could easily write a cron job that backups all your files in Digital Ocean Spaces. However, some people are not really comfortable with this approach and prefer to use a GUI. Goodsync is a great solution for people like them. It’s also great for people who want more advanced setups, like backing up Digital Ocean Spaces every hour to their Google Drive, keeping deleted files 30 days in a bin and keeping multiple versions of files. Let me show you how it works.

Setting up GoodSync

Once you buy GoodSync (the free version can only backup/sync 100 files) and set it up, you just open the application and click “New Job”.

You can now choose if you just want backup (one-way) or synchronization (two-way). You could actually use Digital Ocean Spaces as an alternative to Dropbox, but chances are pretty small that you want to do that (as it’s just not made for this use case). So we’re going with the Backup option.

Now we have to choose a left side (source) and right side (destination) for our backup. The left side will of course be Digital Ocean Spaces while the right side will be a location on our hard drive or another cloud destination (there are a lot of possibilities with GoodSync). Click the source folder. A new window will open showing all the possible sources. Choose Amazon S3.

You’ll notice we have to provide an Access Key and Secret Access Key. Go to https://cloud.digitalocean.com/spaces and click Manage Keys.


Scroll down to Spaces Access Keys and click Generate New Key in the upper right corner. Give the keypair a recognizable name and copy both the Access Key and Private Key to GoodSync. Now the only thing left to provide is the URL. The URL is actually the endpoint of your Digital Ocean Space, like ams3.digitaloceanspaces.com or nyc3.digitaloceanspaces.com.

The URL is the endpoint of your Digital Ocean Space.

Now click Connect. You’ll get a list of all the folders in your Digital Ocean Spaces. Select the folder that you want to backup (you can select multiple folders) and proceed. Now the left side of the backup is complete. Click the right side (destination) and choose where the files should be stored. This can be a folder on your computer or even a different cloud destination (like Google Drive, Dropbox or Backblaze). Once you’ve selected a destination, the job is ready and can start protecting your Digital Ocean Spaces.

Analyze

It’s a good idea to let GoodSync analyze all the files in your Digital Ocean spaces just to confirm everything is working. It will also show you if the files have already been backed-up to the destination. On the GoodSync dashboard, just click the Analyze button. It can take a while if you have a lot of files, but eventually you’ll get the list.

GoodSync shows a list of all the files in our Digital Ocean Spaces and if they are already available in the destination.

You can now click the button ‘Sync’ to copy all the files from the left side to the right side. However, you eventually want all this to happen automatically. This can be set up really easy, just click the Auto button at the upper right corner. You can let the job run on file change, on folder connect, on GoodSync start, etc. The most convenient thing is probably to let GoodSync do the job at a specific time. I’ve configured GoodSync to do the job at night, since my bandwidth is only unmetered at night. It also helps that I have a mini computer running day and night. Just choose the preferred way of automatically syncing and confirm. After a few days, make sure to check in now and then to check if everything is still running correctly.

Other settings worth investigating

GoodSync offers a lot of handy options to get your backups just the way you want them. You can find these options by selecting the job in the GoodSync Dashboard and then clicking Options in the upper right corner. Some options worth considering are things like the recycle bin. It’s really handy to let GoodSync store multiple versions of files to have some kind of version history. If you’re running GoodSync on a computer that you just keep running but not really check on quite often, it’s also handy to let GoodSync send you an email when the backup failed. You can set those notifications up at the tab Scripts.

Enjoy your sleep

You’ll sleep like a baby after setting up GoodSync, knowing that you have your own back-up of your Digital Ocean Spaces. You can do a lot more things with GoodSync, like using SFTP as a source so you can even backup entire Digital Ocean servers. Have fun with it!

You’ve successfully subscribed to Teebow Blogs
Welcome back! You’ve successfully signed in.
Great! You’ve successfully signed up.
Success! Your email is updated.
Your link has expired
Success! Check your email for magic link to sign-in.