I recently downgraded my EC2 instance. I can no longer connect to RDS. I think it might be that the internal IP is different and now the logins are attached to that specific IP. I haven't been able to figure it out. I would like to be able to get a backup from the snapshot. Is there a way to download it through AWS?
8 Answers
You can't download an RDS snapshot. You can however connect to it and export your databases. Downgrading your instance should not affect connectivity unless you had set up your security groups incorrectly (Opening ports to an IP instead of another security group).
-
I have verified that the EC2 instance can connect by telnet to port 3306 on the RDS endpoint. However my logins do not work. My security group did not even have mysql specified (I think that is for inbound into the EC2 instance anyway). The db security group has the EC2 security group specified which my EC2 instance also has. I believe that is how it is supposed to be set up. That is what worked initially. I just tried an older password than the one that was in my files and it worked. It is good to know for sure that one cannot download an RDS snapshot though. Thank you!– WilliamFeb 17, 2013 at 3:11
-
7How do you connect to a snapshot? Can it be done without restoring that snapshot to the db?– ScotterCAug 19, 2013 at 20:27
-
13
-
6@datasage an example of this would have been good. Pretty lazy answer– hmedia1Oct 3, 2018 at 13:08
-
7
The accepted answer is not up-to-date anymore. Instead of using command line tools, you can use the AWS console.
Navigate to RDS -> Snapshots -> Manual/System ->
Select Snapshot -> Actions -> Export to S3
Going through S3 is common in most production environments, as you won't have direct access to the DB instance.
-
2as a clarification : this is only true in a selected list of regions, not available everywhere: aws.amazon.com/about-aws/whats-new/2020/01/… Mar 4, 2020 at 9:33
-
2I'm getting "Missing required key 'KmsKeyId' in params" every time I attempt to export a snapshot. Are we forced to use encryption?– BenMorelJan 21, 2021 at 14:02
-
1
-
1You can export to to S3, from which you could download, but then it will be encrypted using KMS key which you can't download which would make your package useless on any environment remote to AWS. Am I right? Mar 18, 2021 at 5:51
-
7
In addition to datasage answer.
As an option for production instance you can create a readonly replica in RDS and make dumps from this replica. You could avoid freezing of production DB this way.
We use this scheme for PostgreSQL + pg_dump
. Hope it will be helpful to somebody else too.
I use:
pg_dump -v -h RDS_URL -Fc -o -U username dbname > your_dump.sql
-
2Thank you for your answer - although code/config snippets might provide some limited short-term help, a proper explanation would greatly improve its long-term value by showing why this is a good solution to the problem, and would make it more useful to future readers with other, similar questions. Please edit your answer to add some explanation, including the assumptions you've made.– kenny_kOct 7, 2019 at 13:40
-
I also needed to do this so I created a dump of the db (MySQL) by logging into my app server which has permissions to access the db. I then downloaded the dump to my local machine using scp. I used:
mysqldump -uroot -p -h<HOST> --single-transaction <DBNAME> > output.sql
-
This is unhelpful for two reasons: first of all it doesn't answer the question, and second of all this requires connecting with the RDS instance, and OP is asking this question precisely because they can't.– toon81Mar 26, 2019 at 11:48
-
@toon81 actually he covers connection issue. If you unable to connect from outside, you would be able to connect from EC2, if that's VPC issue. Jun 22, 2019 at 18:28
-
@BogdanMart Since downgrading their EC2 instance, OP is unable to connect, suggesting that they were trying to connect from the EC2 instance all along. Anyway, it still doesn't matter because OP isn't asking about how to connect. I think they should be, but the fact remains this question is about something else.– toon81Jun 23, 2019 at 21:55
Another option is to share your snapshot if you don't need to download it and just want to share it with a different AWS account ID.
-
You will need to share master key as well, or it won't be possible to decrypt the snapshot. Aug 28 at 9:20
It sounds like your RDS is within a VPC inside a private subnet with security group and ACL. The only way to solve your issue is to take a snapshot and cerate a new DB instance out of it within the default VPC where all connections are allowed. After that you take backup classic backup using a db client or CLI.
The "Export to S3" option worked for me. I was able to restore only the table I wanted and view it locally using the "Tad" app.