Backup Source DB

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.

  1. Connect to your Source-NET-DB Server as explained in Connecting your Windows Instances section.

    • You can find the Source DB Server by navigating to EC2 service as shown below. Source DB server name is “Source-NET-DBServer” 6_db

      Ensure to get the DB server password as described in Connecting your Windows Instances section.

  2. Once you log in, From Start menu, click “Microsoft SQL Server Management Studio”

    6_db

  3. In the connection window, Enter the below parameters:

Parameter Value
Server name .
Authentication SQL Server Authentication
Login sa
Password password-1

6_db 4. Once you are connected to the Database engine, Right Click to “MySiteDB” under Databases and select “Backup” as shown below. 6_db 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_db 6. Once backup completed, you will get the notification as below: 6_db 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.

  1. 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>>
    
  2. Once you run the command, navigate to your S3 bucket, you should see the MySiteDB.bak file uploaded into this bucket. 6_db