Rackspace Cloudvent Calendar Day 19: Backing Up Your Cloud Database

In the spirit of the holiday season, I’m sharing some tips and features of our cloud that you may not know about. In this countdown I’ll have 24 posts for you, each covering a single topic or feature about Rackspace Cloud products. We’ll post one per day so keep checking back!

On day 3 we discussed Polyglot Backup – how to avoid disaster by implementing a backup strategy that involved images and the Cloud Backup service. What about backing up data that exists in a service, like Cloud Databases? Today, we need to use the API to create a backup. Support for database backups in the control panel is coming soon! Let’s start by creating a backup of our database. You’ll need the UUID of your database instance and create a JSON file:

{
    "backup": {
        "description": "My Backup", 
        "instance": "f07ac506-1a99-4a2a-9a32-869b453019ef", 
        "name": "snapshot"
    }
}

Next, pass this file in your request to the API:

curl –s –X POST –d backup.json –H “Content-type: application/json” –H “X-Auth-Token: $TOKEN” https://ord.databases.api.rackspacecloud.com/v1.0/1234/backups

If you need to restore a backup, you’ll need a different JSON file with the UUID of your backup:

{
    "instance": {
        "flavorRef": 1, 
        "name": "json_restore", 
        "restorePoint": {
            "backupRef": "8c40f9c2-6fe8-4b6b-a823-8a6b1d181f09"
        }, 
        "volume": {
            "size": 2
        }
    }
}

Then you need to pass this file in your request:

curl –s –X POST –d restore.json –H “Content-type: application/json” –H “X-Auth-Token: $TOKEN” https://ord.databases.api.rackspacecloud.com/v1.0/1234/instances

Congrats! You can now backup your database and restore it if needed. Keep checking back this month for more tips!
Rackspace Cloudvent Calendar Day

  • Was this article helpful ?
  • Yes   No

NO COMMENTS

LEAVE A REPLY