I have two purposes for this:

  1. To have an offsite backup in case of a region wide problem with Amazon Web Services.
  2. To copy production data from a production billing account to a beta billing account.

Currently it does not appear that Amazon supports either of these two use cases out of the box.

I have seen mysqldump and xtrabackup (see form post) mentioned.

I have also seen a more complicated process (documented here)

  1. A new RDS server in the source billing account (prod) is spun up off a recent backup.
  2. A new EC2 instance is spun up that has access to the RDS server in step 1.
  3. mysqldump is used to make a backup of this database.
  4. Backup is copied to an offsite location (S3?).
  5. In a separate account and/or region, a fresh RDS server is spun up.
  6. Database dump is imported.

Tips and suggestions are appreciated.

up vote 20 down vote accepted

The recommended way to back up RDS is with automatic backups and DB snapshots. DB snapshots are basically the same as EBS snapshots, which are stored in S3 behind the scenes, but are only available within the same region.

If you need cross-region fault tolerance (good plan!), there is no way to restore your data in another region without doing it "the hard way" from a mysqldump. Your alternatives are to back up using mysqldump (slow and terrible for any reasonable sized dataset), or set up your own EC2-based slave in another region and back that up using any available method (xtrabackup, EBS snapshots, etc). However, then you are back to managing your own MySQL instances, so you might as well abandon RDS entirely.

For my money, RDS provides absolutely no benefits in really any way and a whole lot of disadvantages in performance, flexibility, and reliability. I would ask yourself what value RDS provides to you.

  • For my current needs mysqldump may work ok. I'm not expecting massive datasets and I don't generally need the data moved too quickly. I'm hoping that RDS will support a feature to spin up a new server off a snapshot in another account. Another useful feature would be to import/export the snapshots out of Amazon using either S3 or their Import/Export server. Anyway, thanks for the answer. – Peter Stephens Feb 1 '12 at 22:47
  • 4
    RDS Snapshots can now be copied to other regions. See this announcement and this documentation for details. – shelley Feb 21 '17 at 18:32

I had the same issue. My solution was to write a simple bash script. It is limited to a single region however.

Here's the script in question:

#!/bin/bash
NOWDATE=`date +%Y-%m-%d`
BACKUPNAME="$NOWDATE.sql.gz"

echo "Creating backup of database finances to $BACKUPNAME"
mysqldump –user=user –password=password database_name | gzip -9 > $BACKUPNAME

echo "Succesfully created database backup"

echo "Uploading backup to Amazon S3 bucket…"
s3cmd put $BACKUPNAME s3://path/to/file/$BACKUPNAME

echo "Successfully uploaded backup to S3"

echo "Deleting backup file…"
rm $BACKUPNAME

echo "Done"
  • I highly recommend --single-transaction when running mysqldump – user1250 Jun 11 '13 at 15:04

AWS RDS now supports cross-region and cross-account copying of snapshots which will allow you to complete your goals simply using RDS.

You still have to use a dump script method to get backups to S3 at this point. The ability to use S3-IA or Glacier would be good in terms of cost savings as RDS backup costs are at S3 Standard or higher (vary by db).

  • There is a soft limit of 100 manual snapshots per region, per account. – Jude Piereis Oct 25 '17 at 0:18

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.