Documentation on AWS RDS "migrate snapshot" - amazon-web-services

I can't seem to find much information about the "migrate snapshot" option in the AWS/RDS documentation.
Is it correct to assume that it creates a new, totally separate database based on that snapshot and leaves the original database intact?

The Migrate Snapshot function spins up a new Aurora DB Cluster from a MySQL DB snapshot.
The Migrate Snapshot button in AWS Web Console is currently active only for MySQL snapshots. Naming and appearance of the button is unfortunate. It would probably be more intuitive to only show that button for when a MySQL snapshot is selected and name it as Restore to Aurora or Launch Aurora Cluster.
You can find more information about that function in the AWS RDS user guide under Migrating an RDS MySQL Snapshot to Aurora subsection of the Aurora on Amazon RDS section.

Yes, if you spin up an instance from an RDS snapshot, it creates a completely new instance and leaves the original intact.

Related

Can I launch a MariaDB RDS instance from a local snapshot in S3?

Can I launch a MariaDB RDS instance from a local snapshot stored in S3?
I know it is possible to launch an instance from an RDS-managed snapshot.
I'd like to know if this is possible, or if I need to restore the local snapshot on an EC2 instance and then use DMS to migrate the data to an RDS MariaDB instance.
Unfortunately, you can't launch a MariaDB RDS instance from a backup file stored in S3. If you were using MySQL (and MySQL only as of writing), you'd be able to use aws rds restore-db-instance-from-s3.
The best approach here would be to use DMS as you've mentioned.

Restore (DB Instance) from AWS Aurora RDS DB backup snapshot to existing DB Cluster

We had a AWS Aurora MySQL RDS DB Cluster (say my-dbcluster) & DB Instance (say my-instance) setup. However due to some issue the DB instance got deleted. We do have backup at the cluster level and I could see those in AWS Console under my-dbcluster -> Maintenance & backups tab -> Snapshots section.
Based on the AWS documentation to Restore from DB snapshot, it should allow to create the DB instance by restoring from the DB snapshot. So on the AWS Console I went on to select the latest snapshot and try to Restore by providing the original DB Instance Identifier and other details. My expectation was that it will create the DB instance under the same DB Cluster (i.e. my-dbcluster) but it created altogether a new DB Cluster and created the DB instance under that. I tried to look for ways to move the DB Instance under the original DB cluster but could not find anything.
My question is, why it does not create/restore the DB Instance under the original DB Cluster, if this is not the default behavior, it should at least give an option to restore the DB instance under the DB Cluster of our choice. How can I achieve that.
Restoring to existing DB is not supported. From docs:
You can't restore from a DB cluster snapshot to an existing DB cluster; a new DB cluster is created when you restore.
You could use mysqldump to get data from your new cluster and import to existing one.

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?
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:
Restore the snapshot to a new cluster (Cluster B).
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.
Delete Cluster B.
Drop the database in your original cluster (Cluster A).
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.
You can use the method suggested by Teddy Aryono to restore the DB cluster.
Now rest is using DB host name, use secret manager to store your credentials so even if db host name is changing after restoring snapshot to new cluster you dont need to update application/lambda configurations.
(of-course you nee to update secret manager details with new host name after restore )
You can restore from a DB cluster snapshot that you have saved. To restore a DB cluster from a DB cluster snapshot, use the AWS CLI command restore-db-cluster-from-snapshot.
In this example, you restore from a previously created DB cluster snapshot named mydbclustersnapshot. You restore to a new DB cluster named mynewdbcluster. You use Aurora PostgreSQL.
Example:
For Linux, macOS, or Unix:
aws rds restore-db-cluster-from-snapshot \
--db-cluster-identifier mynewdbcluster \
--snapshot-identifier mydbclustersnapshot \
--engine aurora-postgresql
For Windows:
aws rds restore-db-cluster-from-snapshot ^
--db-cluster-identifier mynewdbcluster ^
--snapshot-identifier mydbclustersnapshot ^
--engine aurora-postgresql
Furthermore, you can also do it using AWS Management Console, or RDS API. Read this docs for details.

How to make AWS aurora Mysql into a writable instance

I am working on a project where we are creating a new region for resilience purpose.
As we create a new Region for the project, we also plan to create a Read replica of Aurora MySQL DB.
My question here has two parts
If the project in existing region goes down, how to make the read replica of Aurora MySQL in the other region as the new Master and writable?
I searched through few videos and stackoverflow questions and I do understand how to make the RDS mysql as writable instance. but, I don't see how to make such a "read-only" parameter modification in Aurora MySQL!
How could I do this change with a Jenkins Job?
Any help is highly appreciated!
Thanks!
You can use the AWS CLI for this, specifically the:
aws rds promote-read-replica-db-cluster
command which contrary to the name actually applies to Aurora as stated in the documentation for the command:
Note:
This action only applies to Aurora DB clusters.
You can find more information in the AWS documentation for Aurora, specifically the section on Promoting a Read Replica to Be a DB Cluster.
Seems like you should be able to use the Jenkins AWS plugin but there are many options.

Daily automatic backup of mysql database Amazon RDS snapshot to an via SSH

I would like to copy/clone the the database inside the newest RDS snapshot on Amazon RDS to a specific server outside of Amazon. I'm looking for a way to backup the mySQL database of it. I would like also to use a daily cron job that triggers a mysqldump from the newest RDS snapshot directly and copy this mySQL dump to a location on a different server via SSH or FTP.
At the moment the steps are way too time consuming. You need to replicate the snapshot to a new RDS instance, access the database via SSH, dump the database on the local PC and then upload it on another server.
Is there perhaps a different approach or alternative? Thanks already for any good hint, advice and help!
RDS snapshots are an AWS specific thing.
What you are describing is traditional database snapshots, which is pretty much your only option since you cannot download an RDS snapshot. There are offerings to do this, but what you are doing is pretty much the most common way. The only other option is to use an AWS instance to do this on a cron.
If you really want the data from an RDS snapshot, it will add time, but you could clone the RDS snapshot into a temporary instance and back that up to a file.
There is no way to do a mysqldump directly from an RDS snapshot. You have to restore the snapshot to a new server instance and then take a mysqldump of that new server instance.
It sounds like you need to forget about the RDS snapshots and just do daily mysqldumps directly from the database server, via a cron job.