Navigate to RDS Service and select your Database you’ve created earlier.
In the Connectivity & Security tab, copy and note the Endpoint URL for your DB.
In your Source DB Server, Click Connect on the Up Left corner of the SQL Studio.
In the connection window, Enter the below parameters:
|Server name||RDS DB Endpoint URL|
|Authentication||SQL Server Authentication|
|Login||unicorn (If you set a different user while creating your RDS DB, enter it here instead.)|
|Password||awsrocks2021 (If you set a different password while creating your RDS DB, enter it here instead.)|
Once connected, you will see your RDS DB become visible on the left pane as below.
Click Databases on the left pane and Click “New Query” as shown below.
In the Query screen, paste the below command and Click “!Execute” button.
If you defined different RDS DB name while creating earlier. Enter it in below command instead. (e.g. “unicornsql” )
exec msdb.dbo.rds_restore_database @restore_db_name='unicorn', @s3_arn_to_restore_from='arn:aws:s3:::<<insert name of your s3 bucket>>/MySiteDB.bak';
When you run the query, you should see the RESTORE_DB task has been created.
If you see status as “in progress” execute the query again in few minutes.
exec msdb.dbo.rds_task_status @db_name='unicorn';
9. On the left pane, you should see now unicorn DB has been restored from the backup file you’ve created.
You’ve successfully restored your source DB in your Target RDS Database. Now go to next section to update the Application connection strings to direct its traffic to the RDS Database.