How to Restore SQL Database with Different Name Easily

Daniel Jones ~ Modified: December 15th, 2022 ~ Restore Data, SQL ~ 4 Minutes Reading

Restore SQL Database with Different Name

Nowadays, the most common task for DBA is to restore a database for testing and development purpose. But sometimes users want to restore full database in SQL Server with different name. Well, in this blog, we are going to discuss a complete procedure to let users understand how to restore SQL database with different name.

Before we move ahead, users need to understand that it is not an easy method if they are unaware of modern tactics. Other than that, with the right tool, this task can be quite easy.


“Last two week, I have a complete backup of Database1. The backup is finished weekly in the task scheduler and I receive a .bak file. Now I want to restore SQL database with different name (Database2). Can anyone suggest me a trustworthy solution for the same? Any assistance would help clarify.”


Moreover, the RESTORE WITH MOVE option enables to restore full database, but also identifies a new location for data files such as .mdf and .ldf. If users try to restore an existing database from the database backup then this is not necessary, but if they are restoring the database with a different file location then you may use this option.

This option allows determining the name of database files and what is the location for created files. Before using this option, users need to check the logical names for the files and where the SQL Server can restore files if they do not use restore database with move option.

If another database already exists with same file name when users try to restore and the database is online the restore failed. However, if the database is offline due to some reason and files cannot be opened, restore will overwrite the data if users do not use WITH MOVE option, so be sure to not accidentally overwrite great database files. Further, when using restore database with move option make sure that the account used for SQL Server engine grants permission to create files in the specified folder.

Restore SQL Database with Different Name – Top Approaches

Go through the following methods by which users can easily restore SQL database with different name. Please have a look:

Approach 1: Using T-SQL (Transact-SQL)

First of all, you have to determine the logical name and physical location for each file. This can be done by using RESTORE FILELISTONLY command. It will provide you both logical as well as physical names.

Here is the example:

  • Restore complete backup WITH MOVE

Now, you need to restore the database, but you have to put database files in “G:\SQLData” folder and transaction log files in “H:\SQLLog” folder. The command will be shown like this:

  • Restore full & transaction log backup WITH MOVE

This WITH MOVE option only be specified for first restore, because after this the database is found in “restoring” state. And the second restore can write the content to a new location which is being used.

Approach 2: Use SQL Server Management Studio

Follow the below steps to restore SQL database using SSMS:

  • On the options page for restore, you need to change “Restore As:” value for each file as given below. This below restores to the root folder, but you can change it by selecting G:\SQLData\ and H:\SQLLog\ as required.

What to do if manual methods fail?

If the above-mentioned manual methods are not capable to restore SQL database with different name. Due to corrupt or damaged database, then try its alternative solution. For a quick and perfect results make use of SQL Repair Tool.

It provides numerous advanced features to its users for a hassle-free recovery process. Moreover, the tool completes the process in a few simple steps in the following way as described below.

Download the tool on your system.

Download Now Purchase Now

  1. After this, run it and add the MDF file.Import MDF file in SQL server
  2. Choose a scan mode and MDF file version.fix Suspect Database in SQL Server
  3. Preview complete database and hit Export button.Recover Deleted Functions And Views in SQL Server
  4. Choose SQL Server Database as export option.Attach MDF File Without LDF File
  5.  Now, choose Create New Database option and provide a different name for the database as per your choice.recover corrupt SQL database
  6. Choose the database object you want to restore and click Export button.Attach MDF File Without LDF File

Wrapping Up

Sometimes users have deleted some records in that case, they need to create another database with different name. So, in this blog, we have discussed step-by-step procedure to restore SQL database with different name. Make sure you follow all the above steps very carefully.

Finally, we can say that SQL server restore database with different name task is easy for users using the automated solution. Otherwise, the manual solution is full of risk.