pkaramol
pkaramol

Reputation: 19412

Quickest way to copy RDS to new database

I have a production RDS in a region (say Ireland).

I want to create a staging environment (say in London) and I need the production data.

One way to go about this is the typical mysqldump / RDS creation in the new region / mysqlimport.

I was wondering whether the following will work.

a) Create a read replica from my production RDS to London (i.e. the region I want my staging environment); (I can tolerate some minor data loss due to the async nature of the above replication)

b) Promote the new read replica (in London) into primary db;

My only concern is whether step b will invalidate my production RDS in Ireland; Can I somehow avoid this?

Upvotes: 0

Views: 213

Answers (1)

Michael - sqlbot
Michael - sqlbot

Reputation: 179364

Promoting a replica to primary in RDS (and MySQL in general) has no impact on the original master. Promoting a MySQL asynchronous replica makes it an independent master, permanently disconnecting it from its original upstream master. The production data will be present on the new instance as it existed at the moment the connection was severed. No updates or resynchronization is supported, because promotion is one-time and permanent.

The two instances are not peers in a cluster (even if in the same region), so the newly-promoted master does not replace/override/modify/invalidate the old one in any sense -- unless, of course, you also change your application to point to the new instance... which you won't be doing.

Upvotes: 1

Related Questions