Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Task 03 - Backup on-premises SQL database

Introduction

Tailspin Toys wants to migrate their on-premises SQL Server database to Azure SQL Managed Instance. In this third task you will backup the on-prem database and upload it to an Azure Storage Account.

Description

In this task, you will backup the on-prem database and upload it to an Azure Storage Account.

The key tasks are as follows:

  1. Install the Azure SQL Migration extension on Azure Data Studio.
  2. Backup the on-prem database using a Full backup type.
  3. Store the backup on an Azure Storage Account

Success Criteria

  • Perform a Full backup on the on-prem database
  • Store the backup on an Azure Storage Account.

Solution

Expand this section to view the solution
  1. In the tailspin-onprem-sql-vm virtual machine, open the Start menu, then type Azure Data Studio to search the application, then select it to run Azure Data Studio.

    The Search results in the Start menu show a search for Azure Data Studio.

  2. On the left, select the Extensions tab, then select the Azure SQL Migration extension and install it.

    Azure Data Studio is shown displaying the Extensions pane with the Azure SQL Migration extension selected and the Install button is highlighted.

  3. Next, you need to enable Preview Features within Azure Data Studio. Select the Manage icon (shown as the Gear in the lower left corner of Azure Data Studio) and select Settings.

    The Manage menu is shown with the Settings option highlighted.

  4. On the Settings pane, type Enable Preview Features in the search box at the top, then check the Enable unreleased preview features box for the Workbench: Enable Preview Features option that shows in the search results. This will autosave.

    The Settings pane is shown with search results for Enable Preview Features showing the Enable unreleased preview features option selected.

  5. Next, let’s connect to the on-premises SQL Server. Select the Connections tab on the left side of Azure Data Studio, then select New Connection.

    The Connections pane is shown with the New Connection button highlighted.

  6. On the Connection pane, enter the following values to connect to the on-premises SQL database, then select Connect:

    • Connection type: Microsoft SQL Server
    • Server: localhost
    • Authentication type: Windows Authentication
    • Database: WideWorldImporters
    • Trust server certificate: True

    The Connection Details pane is shown with values entered and fields highlighted.

    If you encounter a Connection error, always select Enable Trust server certificate.

    The Connection error popup is shown.

  7. In the list of servers, right-click the localhost, WideWorldImporters server, then select Manage.

    The right-click menu for the 'localhost, WideWorldImporters' server is shown with the Manage option highlighted.

  8. Select Backup Database (Preview).

    The Manage page for the database is shown with the Backup button highlighted.

  9. On the Backup Database pane, make sure the Backup type is set to Full, select the Reliability option to Perform checksum before writing to media, then make a note of the location of the Backup files, and select Backup.

    The Backup database dialog box is shown with the Backup type set to Full and the Reliability set as desired.

  10. Open Microsoft Edge, go to the following link and download the Microsoft Azure Storage Explorer.

  11. Select Open file to run the Microsoft Azure Storage Explorer installer once it’s finished downloading and follow the prompts to install the tool.

    The Microsoft Azure Storage Explorer Setup Mode is shown.

    The Microsoft Azure Storage Explorer Setup Wizard is shown.

  12. Launch Microsoft Azure Storage Explorer.

  13. Select Sign in with Azure.

    The Azure Storage Explorer window is shown with the Sign in with Azure button highlighted.

  14. Sign in with your Microsoft Account.

    If you encounter an error signing in with your account, please follow the following steps before proceeding the the next step.


    1. Select Attach to a resource.

    The Azure Storage Explorer window is shown with the Attach to a resource button highlighted.

    1. Select Storage account or service.

    Storage Explorer is displaying the Connect to Azure Storage with Storage account or service kind selected.

    1. Select Connection string (Key or SAS) and then select Next.

    Storage Explorer is displaying the Connect to Azure Storage with Connection string method selected.

    1. In the Azure Portal, navigate to the Resource Group for the lab, then navigate to the tailspinsqlmistor storage account.

    Azure Portal displaying the list of resources with the storage account highlighted.

    1. On the left, select Shared access signature under Security + networking.

    Azure Portal Storage account with Shared access signature option highlighted.

    1. Select all the needed options and then select Generate SAS and connection string.

    Azure Portal Storage account showing the generation of a SAS key highlighted.

    1. Copy the Connection string value.

    Azure Portal Storage account new SAS key details.

    1. Paste the copied value into the Connection string: field and then select Next.

    Storage Explorer is displaying the Connect to Azure Storage with Connection Info details.

    1. Review the details and then select Connect.

    Storage Explorer is displaying the Connect to Azure Storage with entered details.

  15. In the Explorer pane, expand the Azure Subscription, locate the previously created Storage Account (named similar to tailspinsqlmistor), then expand Blob Containers and select the sql-backup container.

    Storage Explorer is displaying the Storage Accounts list with the previously created storage account and the nested Blob Containers tree expanded with the sql-backup container selected.

  16. In the sql-backup container pane, select Upload, then select Upload Files….

    The Upload button menu is shown with the Upload files option highlighted.

  17. In the Upload Files dialog, in the Selected files field, select the Database Backup File (.bak) for the WideWorldImporters database you created earlier, then select Upload.

    The Upload Files dialog box is shown with the sql database backup file selected within the Selected filed field.