Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > Guides > Dashboard Users Guide > Clouds > AWS Regions > RDS Instances > Actions > Migrate from RDS to ServerTemplates

Migrate from RDS to ServerTemplates

Objective

To migrate from an Amazon RDS instance to an instance that is launched and created by using one of RightScale's database manager ServerTemplates. (e.g. Database Manager for MySQL 5.5 or Database Manager for MySQL 5.1)

Prerequisites

  • Operational RDS instance running MySQL 5.1/5.5
  • 'actor' and 'security_manager' user role privileges

Overview

If you are currently using an Amazon RDS instance for a database, but now want to use a ServerTemplate to launch and manage your database so that you have more control and visibility of your database, you can follow the steps below to migrate a running RDS instance to an instance that is launched and configured using a ServerTemplate instead.

Note: The steps only apply to an RDS instance running MySQL 5.1 or 5.5. Support for Oracle databases will be provided at a later time when Oracle ServerTemplates become available.

Steps

  1. Launch a "master" database server using one of the supported MySQL ServerTemplates published by RightScale. To perform a migration, you should launch the instance in the same region and zone as the running RDS instance. Follow the appropriate setup tutorials, however you must stop after the "Initialize the Master Database Server" step because you're going to import the database directly from a running RDS instance instead of importing a mysql dump file from an ROS container. (e.g. Amazon S3 bucket)
  2. Copy the private (not public) IP address of the new database server that you just launched. (e.g. 10.196.30.162)
  3. Navigate to the running RDS instance. (Clouds > the AWS region > RDS Instances)
  4. Click on one of the RDS instance's security groups. Update one of the security groups by adding a new firewall permission that will allow ingress communication from the new "master" database server.
  5. Click the Add CIDRIP button and add a strict firewall permission that will only allow access from the specified IP address using the copied private IP address from the "master" database server. (e.g. 10.196.30.162/32)  Note: Although you can use the Add EC2 Group option to add a firewall permission, it is less restrictive as using an IP-specific rule using CIDR (/32).
  6. Wait for the specified IP address/range to be authorized before going to the next step.
    screen-authorizedIP-v1.png
  7. SSH into the "master" database server and run the following command to create and import a mysqldump file from the running RDS instance. The following command accomplishes the same task as the 'db::do_dump_import' script. Navigate to the RDS instance's Info tab to retrieve the required information. (Note: You can also save the mysqldump file to a directory on the "master" database server if you want to import the database at a later time.)

       Example: # mysqldump -h do-rds.co5bfhq1mv4s.us-west-1.rds.amazonaws.com -u foo -pbar test | mysql -u root

       rds_host: RDS instance's endpoint address. (e.g. my-rds.co5abcd1mv4s.us-west-1.rds.amazonaws.com)
       rds_user: Master username of the RDS instance. (e.g. foo)
       rds_password: Master user password of the RDS instance. (e.g. bar)
          IMPORTANT! - There shouldn't be any space between the '-p' and the password value. (CORRECT: -pbar) (INCORRECT: -p bar)
       database_name: The name of the mysql database. (DB name)
# sudo -i

# mysqldump -h <rds_host> -u <rds_user> -p<rds_password> <database_name> | mysql -u root
  1. Verify that the database was imported correctly.
# mysql

mysql> show databases;

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)
  1. Create a primary backup of the database. Go to the "master" database server and run the 'db::do_primary_backup' operational script.
  2. (Optional) Launch a slave database server for high availability and disaster recovery purposes. See Initialize a Slave Database Server.
  3. Terminate the RDS instance.

 

Save mysqldump file to a directory

If you prefer to create a mysqldump file and save it to a directory so that you can upload it to an ROS container (e.g. S3 bucket), run the following command to create a mysqldump file from the running RDS instance and save it to the /tmp directory of the "master" database server.

Note: Remove '> /tmp/mydumpfile.sql' from the string to view the dump file in stdout format.

# sudo -i

# mysqldump -h <rds_host> -u <rds_user> -p<rds_pass> <database_name> > /tmp/<mydumpfile>.sql

mydumpfile: The filename of the mysql dump file that will be created.

You must to post a comment.
Last modified
22:23, 16 May 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.