--- title: Back up and restore a database description: Follow this tutorial to learn how to back up and restore databases using Azure Data Studio. ms.prod: azure-data-studio ms.technology: azure-data-studio ms.topic: tutorial author: markingmyname ms.author: maghan ms.reviewer: alayu ms.custom: "seodec18" ms.date: 11/04/2019 --- # Tutorial: Backup and Restore databases using Azure Data Studio In this tutorial, you learn how to use Azure Data Studio to: > [!div class="checklist"] > * Back up a database > * View the backup status > * Generate the script used to perform the backup > * Restore a database > * View the status of the restore task ## Prerequisites This tutorial requires the SQL Server *TutorialDB*. To create the *TutorialDB* database, complete one of the following quickstarts: * [Connect and query SQL Server using [!INCLUDE[name-sos-short](../includes/name-sos-short.md)]](quickstart-sql-server.md) This tutorial requires connecting to a SQL Server database. Azure SQL Database has automated backups, so Azure Data Studio doesn't perform Azure SQL Database backup and restore. For details, see [Learn about automatic SQL Database backups](/azure/sql-database/sql-database-automated-backups). ## Back up a database 1. Open the TutorialDB database dashboard (open the **SERVERS** sidebar (**CTRL+G**), expand **Databases**, right-Select **TutorialDB**, and select **Manage**). 2. Open the **Backup database** dialog (Select **Backup** on the **Tasks** widget). ![Tasks widget](./media/tutorial-backup-restore-sql-server/tasks.png) 3. This tutorial uses the default backup options, so Select **Backup**. ![backup dialog](./media/tutorial-backup-restore-sql-server/backup-dialog.png) After Selecting **Backup**, the **Backup database** dialog disappears and the backup process begins. ## View the backup status and view the backup script 1. The **Task History** pane appears or press **CTRL+T**. ![Task history](./media/tutorial-backup-restore-sql-server/task-history.png) 2. To view the backup script in the editor, right-Select **Backup Database succeeded** and select **Script**. ![backup script](./media/tutorial-backup-restore-sql-server/task-script.png) ## Restore a database from a backup file 1. Open the **SERVERS** sidebar (**CTRL+G**), right-Select your server, and select **Manage**. 2. Open the **Restore database** dialog (Select **Restore** on the **Tasks** widget). ![Task restore](media/tutorial-backup-restore-sql-server/tasks-restore.png) 3. Select **Backup file** in the **Restore from** field. 4. Select the ellipses (...) in the **Backup file path** field, and select the latest backup file for *TutorialDB*. 5. Type **TutorialDB_Restored** in the **Target database** field in the **Destination** section to restore the backup file to a new database. Then select **Restore**. ![Restore backup](./media/tutorial-backup-restore-sql-server/restore.png) 6. To view the status of the restore operation, press **CTRL+T** to open the **Task History**. ![History task restore](./media/tutorial-backup-restore-sql-server/task-history-restore.png)