1

I have a large PostgreSQL DB (around 100GB) which is on EC2. I want to migrate it to RDS.

How can I achieve this with minimal downtime?

Colin 't Hart
9,51015 gold badges37 silver badges44 bronze badges
asked Nov 8, 2014 at 6:00

2 Answers 2

2

You can't do it with minimal downtime, or not easily anyway.

RDS doesn't support importing base backups and doing streaming replication to/from outside servers.

See Getting WAL from AWS RDS and Moving a standalone DB to Amazon RDS.

You'll have to dump and reload.

If you're keen, you could instead set up Londiste or a similar tool to stream changes from the standalone server into RDS, with the Londiste pgq daemon and the subscriber daemon both running on AWS EC2. The subscriber would connect remotely to RDS over the PostgreSQL protocol. This lets you use trigger based replication to keep the DBs in sync, giving you a shorter outage window. You still have to disable writes on the old DB and make sure Londiste is fully caught up before switching over, though.

answered Nov 8, 2014 at 12:02
3
  • RDS Read Replicas were announced about two days after your post, including a suggestion for using Londiste for building up the replica. Although I don't know how you switch over without disabling writes, as you point out. Commented Sep 8, 2015 at 23:47
  • 1
    @jwadsack RDS read replicas are not a way to get WAL into or out of RDS, which is what this is about. The article you links to mentions using Londiste for that, as I did above. Read replicas will do absolutely no good for migrating from EC2 to RDS, as this question asks. Commented Sep 9, 2015 at 0:27
  • Thanks for the clarification. I had assumed one could set up a read replica to an external server (based on things I had read elsewhere). But I couldn't figure out how to do that in RDS because it you have to set up the master in RDS and create a replica of that. And now that I read that article more closely, I see you are right. There's no mention of Read Replicas for data import. Commented Sep 9, 2015 at 15:11
1

Amazon has a tool for doing exactly this, called the RDS Migration Tool, and there is also AWS Migration Service. The migration tool has to run in windows, however, last I looked.

answered Sep 30, 2016 at 15:09
1
  • now the tool also runs on other OS, at least I've tried it in OSX Commented Mar 10, 2017 at 14:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.