You can use not only native sql server backup but any other sql server functionality for data migration. I would highlight the following options for resolving your case.
Sql server native backup
1.Native sql server backup\restoe
RDS Sql Server doesn't support T-SQL CREATE DATABASE commands. However, you can do a native backup on S3 using the stored procedure
EXEC [msdb].[dbo].[rds_backup_database]
@source_db_name = '<database name>',
@S3_arn_to_backup_to = N'arn:aws:s3:::<bucket name>/sample.backup'
For this stored procedure to work, you need to do a little pre-configuration. More details can be found here
From the point of view of speed - creating a native backup will be the most optimal, but this method is not very convenient to use. When launched, the stored procedure does not create a backup directly but creates a “task” that needs to be monitored. And only when this task is successfully completed can you copy the backup from S3 to your local server.
To restore a backup file to a local server, use SSMS: Databases -> Right-click -> Restore database
2. Export\Import data tier application
Export\import bacpac is a mechanism for migrating a database from one server to another. You can export\import your database using either SSMS or the sqlpackage utility.
Export data-tier application does not guarantee transactional data consistency. For the exported file to be transactionally consistent, you need to ensure that there are no writes operations during the data export.
To restore a .bacpac file to your local server, use SSMS: Databases -> Right-click -> Import data-tier application
More details about both options can be found here
3. Generate t-sql script
If your database is not very large then you can create a T-SQL script that contains instructions for restoring the database.
- Open SSMS
- Right-click on the database
- Tasks -> Generate script
- At the Set Scripting Options step go to Advanced
- Set Types of data to script to "Schema and data" value
Creating t-sql script is the slowest but also the most flexible way to copy a database. In the advanced settings, you can choose many options for script creating.
As well as the export data-tier application, it is necessary to ensure that there are no writes operations to the database during the export.
To restore to a local server, drag the files into SSMS and press F5. But if the file is too large, then use the sqlcmd
utility