user11508332
user11508332

Reputation: 667

getting a local copy of an aws rds snapshot

In AWS, I have snapshot continually being taken on a daily basis, and I need to be able to view the state of the database at the time a particular snapshot was taken (but I don't want to restore to the snapshot just yet). Is there any way to somehow download the snapshot via something like a mysql dump? Even if this can't be done directly is there a workaround?

Upvotes: 3

Views: 7924

Answers (2)

My solution has been to ignore the S3 export and instead take the snapshot, turn that into its own temporary (postgres flavoured) database so that it can be connected to over the network. AWS might call it "restore" but they mean "restore it from a compressed snapshot archive to a working database", not "overwrite your existing database with this data". It restores your snapshot as a new database.

You can then use pg_dump to get a copy of the DB using the pg URL, and while that'll be slower than exporting to S3 (but since it's a snapshot, speed doesn't really matter) it has the upside of having useful data at the end of it rather than parquet files.

And then, of course, remember to delete the temporary database (and depending on whether it's a scheduled snapshot or a one-off, the snapshot itself)

Upvotes: 0

Jason Wadsworth
Jason Wadsworth

Reputation: 8887

Snapshots cannot be downloaded. If you need to download it you should probably do MySQL backups to S3. Those are standard backups that can be used in another MySQL database server.

Upvotes: 6

Related Questions