A common day to day task for a DBA is to backup/restore databases for testing/development/production purposes. In this blog we’ll see how to restore database backup to different name.

Let’s first look at the easy way the GUI way. Connect to an instance and

Right click on “Databases” node and select “Restore Database” as shown in below image. This will open a Restore Database dialog box.

1_restore database backup to different name

In Restore Database Dialog box click the highlighted button to add the database backup device. This will open the Select backup device dialog box.

2_restore database backup to different nameIn the Select backup device dialog box, navigate the folder directory and add the backup device to restore the database from. Click OK to continue.

3_restore database backup to different name

The database name and the backup file details will be automatically populated in the Restore database dialog box. Change the database name to the new name to be restored too.

4_restore database backup to different name

On the left pane in restore database dialog box, click on Files and review the file names under Restore As column. SQL Server has automatically changed the filenames from AdventureWorks2014_data to AdventureWorks_Data.

Click OK on restore database dialog box. The restore will start and the progress will be shown as seen in below snapshot.

6_restore database backup to different name

The database AdventureWorks2014 has been restored as a new database AdventureWorks.

The other way is to use the T-SQL script

The above query restores the backup of AdventureWorks2014 database as a new database AdventureWorks. The database files are moved to AdventureWorks_data with the MOVE command. The STATS=5 command shows the progress of restore operation in an interval of 5%.

 

Regards

Ahmad Osama

Like us on FaceBook Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook