Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
361 views
in Technique[技术] by (71.8m points)

amazon web services - How can I restore a snapshot to an existing Aurora db instance?

I redeployed an Auraro cluster (postgresql 11). I did it by delete the existing one and re-create a new one. I have snapshot backup from the previous db instance and I'd like to restore the data to the existing instance.

I understand that Aurora doesn't support it. Is there a workaround for me to do that? Like whether I can download the snapshot to local in plain sql script format. Then manually restore them to the new instance?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I understand that Aurora doesn't support it. Is there a workaround for me to do that? Like whether I can download the snapshot to local in plain sql script format. Then manually restore them to the new instance?

You can certainly accomplish that by doing the following:

  1. Restore the snapshot to a new cluster (Cluster B).
  2. Export the data from that cluster using pgdump or mysqldump depending on the Aurora database engine you are using. I suggest doing this in an EC2 instance in the same VPC.
  3. Delete Cluster B.
  4. Drop the database in your original cluster (Cluster A).
  5. Load all the data from the export into Cluster A.

However, at that point all you have accomplished is that you will have maintained the RDS cluster's endpoint URL. If you design your system to allow changes to the RDS endpoint URL, then it would be much easier for you to simply restore the snapshot to the new cluster, swap the endpoint your application connects to, and delete the old cluster.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...