November 24th, 2020
March 1, 2021
The common tasks that appear are to backup/restore the SQL database for further use. But sometimes users need to restore the full database in SQL Server with a different name. Well, during this blog, we are continuing to discuss a complete procedure to let users know how to restore SQL databases with a different name.
Use of restore with move option allows to restore the full database but also classifies a new location for data files as .mdf and .ldf. If users attempt to restore SQL database from the backup file (.bak) then this is not mandatory. Besides if they are restoring the database with a separate file location then you may use this option. This option is useful to determine the name of the database file and the location of that file. Before applying this option, users are required to check the logical names for the files. Furthermore, check where the SQL Server can restore files if they do not use WITH MOVE option.
You can use different methods or approaches to restore SQL databases with different names.
You can use the transaction-SQL method to restore SQL databases with different names.
Follow the below-mentioned steps:
RESTORE FILELISTONLY FROM DISK = ‘E:\Backup\PeterDatabase.bak’
RESTORE DATABASE PeterDatabase FROM DISK = ‘E:\Backup\PeterDatabase.bak’
WITH MOVE ‘PeterDatabase_Data’ TO ‘E:\SQLRestore\PeterDatabase_Data.mdf’
MOVE ‘PeterDatabase_Log’ TO ‘E:\SQLLog\PeterDatabase_Log.ldf’
RESTORE DATABASE PeterDatabase FROM DISK = ‘E:\Backup\PeterDatabase.bak’,
WITH MOVE ‘PeterDatabase_Data’ to ‘E:\SQLDatabase\PeterDatabase_Data.mdf’,
MOVE ‘PeterDatabase_Log’ TO ‘E:\SQLLog\PeterDatabase_log.ldf’,
Finally, Run the Command.
RESTORE LOG PeterDatabase FROM DISK = ‘D:\PeterDatabase.trn’
This is another way to restore SQL databases with different names. Apply the approaches described below:
7. In the left-hand pane, tap Options, and select the following:
8. Click OK to execute the restore.
Using the following steps, you will be able to restore the SQL database with different names. Both the manual methods to restore the database to SQL Server are practical and helpful. You can either run the Transaction SQL command or SQL Server Management Studio to follow the interface system.
Besides this, the manual method is not error-free. You can face several issues like:
Additionally, inappropriate restoration can delete or damage the data. Now, you know that a wrong step can not only hold the restoration further and corrupt the database. To avoid such circumstances, use a professional approach.
SysInfo SQL Database Recovery Tool is a complete Windows-based product that performs seamless recovery in no time and fix run-time error in SQL Server. It recovers important data from damaged MS SQL database files. The utility strongly restored SQL database objects without any annoyance. The SQL Database recovery tool can efficiently repair and recover corrupt MDF as well as NDF file extension without harming the primary data. Also, the interface of the software is so simple that even a beginner can use it without any technical expertise.
Restore SQL database with a different name is a simple approach if you follow the crucial instructions. If you do the same all will look fine. Besides this, a single wrong step can corrupt the whole data. We suggest you a tool (SQL Database Recovery) to avoid such circumstances. It is capable of restoring the data even from the corrupted files.