Restoring an Elastic Beanstalk Database

Due to the inflexibility of an EB managed RDS database, restoring an application DB from a snapshot can be difficult. The high level process is to allow EB to create (and manage) a new DB, restore the snapshot independently, dump the snapshot locally and restore the dump into the EB managed DB.

In practice, the steps to do this are as follows:

pg_dump -h restored_snapshot_db_identifier.ccjgurhe4rmi.eu-west-2.rds.amazonaws.com -U master -f db_dump.sql ebdb
cat db_dump.sql | psql -h eb_db_identifier.ccjgurhe4rmi.eu-west-2.rds.amazonaws.com -U master -d ebdb