Using native .bak files to back up and restore databases is usually the fastest way to back up and restore databases.
In this section, you will backup your source Database and upload it into S3 bucket which you’ve created earlier.
Connect to your Source-NET-DB Server as explained in Connecting your Windows Instances section.
Ensure to get the DB server password as described in Connecting your Windows Instances section.
Once you log in, From Start menu, click “Microsoft SQL Server Management Studio”
In the connection window, Enter the below parameters:
|Authentication||SQL Server Authentication|
4. Once you are connected to the Database engine, Right Click to “MySiteDB” under Databases and select “Backup” as shown below. 5. On the Backup settings screen, ensure that you’ve selected Backup type “Full” and take note the Backup file location. You will use this location in the next step. 6. Once backup completed, you will get the notification as below: 7. Now, you have the backup file, but in order to upload the backup file to S3 bucket you will need to configure your windows server AWS credentials. 8. Run a Windows Powershell terminal from start menu and run the “aws s3 cp” command to copy the backup file to S3 bucket. Replace your S3 bucket name in the below command.
awscli has already been installed in this machine and you will use the ec2 instance role to access to S3 bucket.You can check AWS CLI details for real life integrations.
aws s3 cp “C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup\MySiteDB.bak” s3://<<insert name of your s3 bucket>>