First we need to create a snapshot of the RDS instance , which is been explained here
Step 2:
Once the snapshot is created in the Source AWS account , We have to grant Snapshot permission to the Target AWS account so that the snapshot can shared.
Login to RDS Console , In the left navigation pane , Choose Snapshots
Select the snapshot of the RDS Instance which you need to migrate to the another aws account.
Under Actions , Click ShareSnapshot
You will be taken to the following page.
Here We are going to add target AWS account.
Choose the DB snapshot visibility,
If you choose Public , It will allow all AWS accounts to restore a DB instance from the manual snapshot
If you choose Private , The manual snapshot will only be restored by the AWS account that I have explicitly granted permissions.
Provide an AWS account Number and then click Add.
You can repeat the same process to add maximum of 20 AWS accounts.Once done , Click Save.
Step 3 : Verification
Now Go to the target AWS account , Choose the Region from where the source AWS account shared the DB snapshot.
Login to RDS Console and then Choose Snapshots.
From the drop down menu , Choose Shared with Me
Important Note
Once the Snapshot is shared by source account , If the Source AWS account removes the Target AWS Account id from the Snapshot permission , The snapshot will automatically be deleted from the Target AWS account.Because the snapshot is still owned by the source AWS account.
In order to avoid that , We need to Copy the snapshot to the same region or any other region in the target account.
Also We can restore the RDS snapshot.
To copy the snapshot , Choose the snapshot in the target account and Under Actions , select Copy snapshot
Select the destination region , and provide a name for the snapshot and then Click Copy snapshot
To Restore the RDS snapshot , Select the snapshot , Under Actions ,
Choose Restore snapshot.
Detailed process on how to restore the RDS DB snsoshot is explained here.
Conclusion
We have successfully migrated the RDS Instances from One AWS account to the Another , Also We have find a strategy to copy the snapshot and restore the snapshot.
Hope you find it helpful.Thanks for reading this article.