Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy a database using RDS

I have a database instance on RDS with 2 databases on it. Is there a good way using the RDS command line tools to copy the one database to the other? If not, what is the recommended way of doing it?

like image 435
ocoutts Avatar asked Sep 27 '10 14:09

ocoutts


People also ask

How do I import data into RDS?

When importing data into a MariaDB DB instance, you can use MariaDB tools such as mysqldump, mysql, and standard replication to import data to Amazon RDS. Importing Data into PostgreSQL on Amazon RDS – You can use PostgreSQL tools such as pg_dump, psql, and the copy command to import data to Amazon RDS.

How do I copy a RDS snapshot from one region to another region?

To copy your encrypted snapshot to a different AWS Region, simply select the destination region during the Copy Snapshot operation on the AWS Management Console or via the AWS Command Line Interface. You do not need to do anything differently to gain the benefits of incremental copies.


2 Answers

This is not an exact solution to the OP, but if all you need is to clone an existing database for a new purpose, there's an easier way. You can take a snapshot from the original RDS instance, then restore it to a new instance. You can even use the web console.

like image 189
solublefish Avatar answered Oct 03 '22 05:10

solublefish


I'd use mysqldump to get the tables and then mysql to import them.


Update 2014/07/08: Depending on what you're planning to do here, another solution today is to setup replication and then to promote the slave to be the master. That is for example if you want to update your database's release/version: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html

If you're looking to backup externally, there's also replication: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Exporting.NonRDSRepl.html

RDS has come a long way.

like image 40
Till Avatar answered Oct 03 '22 06:10

Till