<p>Restoring a snapshot simply creates a new RDS instance.
So if you restore the prod DB snapshot to staging then you will be creating a new RDS instance with the restored data in it.</p>
<ul>
<li><p>If both of the RDS instances are in the same aws account then
You will either have to delete/rename the staging DB and then restore the prod DB</p>
</li>
<li><p>If both of the RDS instances are in different/separate AWS account then you can share the snapshot in other account and restore it there
Here is the aws official doc : <a href="https://aws.amazon.com/blogs/aws/amazon-rds-update-cross-account-snapshot-sharing/" rel="nofollow noreferrer">https://aws.amazon.com/blogs/aws/amazon-rds-update-cross-account-snapshot-sharing/</a></p>
</li>
</ul>
<p>Ps: Another option can be, using mysqldump to take backup from prod and then restoring it to the staging instance</p>

CC BY-SA 4.0
2021-07-09T00:11:10.580Z
They're both in the same account. I certainly don't want to touch the live prod DB also. I think I just want staging now to point at the new RDS instance. I'm just having trouble finding where the EC2 instance says what database backs it.
Clinton
CC BY-SA 4.0
2021-07-20T15:05:23.530Z
Hi, did you manage to solve this? You can try checking your app configuration for the connection strings with your rds endpoint name mentioned in it.
Kunal
CC BY-SA 4.0
2022-03-25T13:52:08.153Z
Hi, did this solve your problem . If yes, would you please accept the answer
Kunal
CC BY-SA 4.0
2021-07-08T17:50:07.640Z
2021-07-08T20:49:48.127Z
2021-07-08T20:49:48.127Z
Kunal
<p>I've a webapp hosted on AWS. This has Electric Beanstalk, with EC2 and then a RDS Postgres database at the bottom.</p>
<p>There's prod, UAT and staging environments and databases.</p>
<p>I want to take a recent snapshot of the prod database (well I've done that) and restore it on the staging database, as the current staging environment is a bit out of data wise.</p>
<p>Yet when I go to restore snapshots in the staging database, I can only restore those which were taken on the staging database.</p>
<p>Is there any way to restore the prod snapshot which I've made to the staging database?</p>

<amazon-web-services><amazon-ec2><elastic><amazon-rds>
AWS: Restoring database snapshot to different environment
Clinton
# AWS: Restoring database snapshot to different environment

(Asked by: username_0 on 2021-07-08)

I've a webapp hosted on AWS. This has Electric Beanstalk, with EC2 and then a RDS Postgres database at the bottom.

There's prod, UAT and staging environments and databases.

I want to take a recent snapshot of the prod database (well I've done that) and restore it on the staging database, as the current staging environment is a bit out of data wise.

Yet when I go to restore snapshots in the staging database, I can only restore those which were taken on the staging database.

Is there any way to restore the prod snapshot which I've made to the staging database?

**Tags:** amazon-web-services, amazon-ec2, elastic, amazon-rds


---

## 1 answers

### Answer by username_1 on 2021-07-08. Score: 1

Restoring a snapshot simply creates a new RDS instance.
So if you restore the prod DB snapshot to staging then you will be creating a new RDS instance with the restored data in it.

* If both of the RDS instances are in the same aws account then
  You will either have to delete/rename the staging DB and then restore the prod DB
* If both of the RDS instances are in different/separate AWS account then you can share the snapshot in other account and restore it there
  Here is the aws official doc : <https://aws.amazon.com/blogs/aws/amazon-rds-update-cross-account-snapshot-sharing/>

Ps: Another option can be, using mysqldump to take backup from prod and then restoring it to the staging instance

> **Comments:**
> **username_0**: They're both in the same account. I certainly don't want to touch the live prod DB also. I think I just want staging now to point at the new RDS instance. I'm just having trouble finding where the EC2 instance says what database backs it.  
> **username_1**: Hi, did you manage to solve this? You can try checking your app configuration for the connection strings with your rds endpoint name mentioned in it.  
> **username_1**: Hi, did this solve your problem . If yes, would you please accept the answer  

---

