Restore Database with a new name

  • Hi all,

    I have a database called DB and I need to restore it on the same Box with different name. Can anybody tell me if this instruction is the correct one? (actual database name DB, new name DB_V2)

    RESTORE DATABASE [DB_V2]

    FROM DISK = N'D:\FullBackup.bak'

    WITH FILE = 1,

    MOVE N'DB' TO N'D:\MSSQL\Data\DB_v2.mdf',

    MOVE N'DB_log' TO N'D:\MSSQL\Data\DB_v2_log.ldf',

    RECOVERY, NOUNLOAD, REPLACE, STATS = 10

    thank you

  • I forgot to mention that my database has the Full Recovery Model, but I dont need the up to date data. Im planing to use the last full backup of this database.

  • MTY-1082557 (3/25/2010)


    Hi all,

    I have a database called DB and I need to restore it on the same Box with different name. Can anybody tell me if this instruction is the correct one? (actual database name DB, new name DB_V2)

    RESTORE DATABASE [DB_V2]

    FROM DISK = N'D:\FullBackup.bak'

    WITH FILE = 1,

    MOVE N'DB' TO N'D:\MSSQL\Data\DB_v2.mdf',

    MOVE N'DB_log' TO N'D:\MSSQL\Data\DB_v2_log.ldf',

    RECOVERY, NOUNLOAD, REPLACE, STATS = 10

    thank you

    Looks correct to me.

    The Redneck DBA

  • I think it looks OK. Test it on a different machine first to verify you get what you need.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thank you everyone.

    It works perfectly 🙂

  • I like to check the logical name as well to make sure I have the MOVE statements correct:

    RESTORE FILELISTONLY FROM DISK = 'D:\FullBackup.bak'

    Shawn Melton
    Twitter: @wsmelton
    Blog: wsmelton.github.com
    Github: wsmelton

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply