Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > FAQs > Can I create MySQL backups on a different cloud?

Can I create MySQL backups on a different cloud?

Background Information

You currently have a server instance running in a cloud infrastructure (e.g. Amazon EC2 regions or Rackspace Cloud) and you want to save a backup in a different cloud in order to create redundant backups and avoid a single point of failure. For example, you might have a MySQL database server running on EC2 and you want to save a dump file of the MySQL database in Rackspace's Cloud Files (cloud storage), or vice-versa.

 


Answer

You can use the DB MySQL mysqldump backup - 11H2 script to save a MySQL dump file to the cloud storage location of your choice.  An Alpha version of the script is currently available in the MultiCloud Marketplace.  You can use the script to save a dump file to an Amazon S3 bucket or a Rackspace Cloud Files container.

By default, the published version of the script is configured for the most common use case for the script where a backup will be stored in the same cloud infrastructure as where the cloud instance is currently running.  (i.e. If you run the script on an EC2 instance, it will create a backup in an S3 bucket; if you run the script on a Rackspace instance, it will create a backup in a Cloud Files container.

However, you can make a couple minor modifications to the script so that you can use it to create backups in a different cloud than where your instance is currently running.

Note: The script is currently Alpha and is part of the 11H2 compatibility release.  But, you should be able to run the script with 11H1 ServerTemplates as long as you run the RB Install Rightscale tools - 11H2 script before running the script.

Steps
  1. Import the following scripts from the MultiCloud Marketplace.  (Publisher: RightScale) (Note: They currently have alpha suffixes.)
    • DB MySQL mysqldump backup - 11H2.a1
    • RB Install Rightscale tools - 11H2.a1
  2. Before you can run the DB MySQL mysqldump backup script on an instance, you must first run the RB Install Rightscale tools script because of script dependencies. 
  3. Run the RB Install Rightscale tools script on the running MySQL database server.
  4. Clone and rename the DB MySQL mysqldump backup script.  (Optional: You may want to commit the script before you make any modifications so that rev1 will be equivalent to the original version of the script.)
  5. Go to the Script tab and remove the 'RS_' prefix from the following line of code, which will create a user-configurable input.
    • # OLD
      /opt/rightscale/sandbox/bin/mc_sync.rb put --cloud $RS_CLOUD_PROVIDER
      
      # NEW
      /opt/rightscale/sandbox/bin/mc_sync.rb put --cloud $CLOUD_PROVIDER
  6. Click Identify.  You should now see CLOUD_PROVIDER in the list of configurable inputs.
  7. Add a tooltip description for the new input and create a dropdown with 'ec2' and 'rackspace' as selectable text values.
    screen-Cloud_Provider_Inputs.png
  8. Click Save.
  9. Commit the script.
  10. Run the cloned script as an 'Any' script on a running instance.  You will need to modify the following inputs to specify the appropriate information to store the dump file in the cloud storage location of your choice.  Use the tooltip for help.
    • CLOUD_PROVIDER - Select the cloud infrastructure where the backup will be saved.
    • DB_MYSQLDUMP_BUCKET - The cloud storage location where the MySQL dump file will be saved.
      • ec2: Enter the S3 bucket name
      • rackspace: Enter the Cloud Files container name
    • DB_MYSQLDUMP_PREFIX - The prefix that will be used to name the MySQL dump file.  (e.g. myprefix)  The created dump file will also have a timestamp in the namespace.  (e.g. myprefix-201104161345.gz)
    • STORAGE_ACCOUNT_ID - In order to write the dump file to the specified cloud storage location, you will need to provide authentication credentials.
      • ec2: Cred:AWS_ACCESS_KEY_ID
      • rackspace: Enter your Rackspace login Username.
    • STORAGE_ACCOUNT_SECRET - In order to write the dump file to the specified cloud storage location, you will need to provide authentication credentials.
      • ec2:  Cred:AWS_SECRET_ACCESS_KEY
      • rackspace: Enter your Rackspace account API Key.
  11. Once the script has been successfully completed, check your cloud storage location for the dump file that you just created.

 

 

Viewing 1 of 1 comments: view all
This is all 11H2 stuff. Is this valid or does it just need to be updated.

Revisit.
Posted 19:48, 22 Oct 2013
Viewing 1 of 1 comments: view all
You must to post a comment.
Last modified
19:43, 22 Oct 2013

Tags

Classifications

This page has no classifications.

Announcements

None


© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.