Published on

April 19, 2024

How to Restore a SQL Server Database on Linux using SQL Server Management Studio

Restoring SQL Server databases is a common task for database administrators. In a previous tip, we discussed how to restore a SQL Server database on a Linux based instance using the sqlcmd utility. In this article, we will explore the same process but using SQL Server Management Studio (SSMS).

Before we begin, it is recommended to read the previous tip where we explained the step-by-step method to restore a SQL Server database on a Linux server. This includes taking a backup and copying the backup file to the target Linux machine for the restore process. For the purpose of this article, we will assume that you have already completed these steps.

Let’s get started with the process of restoring a SQL Server database on a Linux based SQL Server using SSMS:

Step 1: Connect to the Linux Server

First, connect to the Linux server through SSMS on your Windows machine. Right-click on the ‘Database’ folder and choose the “Restore Database…” option.

Step 2: Select the Backup File

In the “Restore Database” window, choose the “Device” option as the source. Click on the ellipse next to this option to select the backup file.

A sub-window will appear asking you to select the backup devices. Click the “Add” button to select the backup file for the restore process.

Step 3: Specify the Backup File Path

In the separate window that appears, choose the backup file path from the displayed location. Make sure the correct backup file is selected.

Step 4: Confirm the Backup File

Once you have selected the backup file, click the “OK” button to proceed. The main “Restore Database” window will display the details of the backup file.

Step 5: Select the Destination Database

Click on the checkbox below “Restore” to select the backup file. Change the database name in the destination section if necessary.

Step 6: Update the File Locations

In the “Files” tab, update the destination file names and locations for each database file. Since there is a different directory structure in Windows vs. Linux, it is important to change the location and file name of each database file.

Click on the three dots next to each database file in the “Restore As” column. Enter the correct data file location and file name for each file.

Step 7: Restore the Database

Once you have updated each data file along with the corresponding location, click OK to restore the database.

Step 8: Validate the Restored Database

Finally, validate whether the restored database is accessible. Check if the tables and data from the source database are available in the restored database.

That’s it! You have successfully restored a SQL Server database on a Linux based SQL Server using SQL Server Management Studio.

Remember to regularly backup your databases and follow best practices for database administration to ensure data integrity and availability.

Click to rate this post!
[Total: 0 Average: 0]

Let's work together

Send us a message or book free introductory meeting with us using button below.