Error when trying to restore SQL 2000 db to SQL 2008

Posted on 2008-11-18
Last Modified: 2012-05-05
I get this error when trying to restore a 2000 db to 2008:

System.Data.SqlClient.SqlError: File 'E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\NGTest.mdf' is claimed by 'NextGen_Core_Data_1'(4) and 'NextGen_System_Data'(1). The WITH MOVE clause can be used to relocate one or more files. (Microsoft.SqlServer.Smo)
Question by:biotec
    LVL 51

    Accepted Solution

    Sounds like you have a few partitions involved, or filesystems...

    Need to include the "MOVE" command, or if using SSMS, then overwrite the backup file names to be what they really are for the target database being restored into, and click the overwrite existing...

    or use SQL :

       FROM AdventureWorksBackups
       WITH  MOVE 'AdventureWorks_Data' TO 'C:\MySQLServer\testdb.mdf',
                  MOVE 'AdventureWorks_Log' TO 'C:\MySQLServer\testdb.ldf';

    Author Comment

    Msg 3234, Level 16, State 2, Line 1
    Logical file 'NGTest_Data' is not part of database 'NGTest'. Use RESTORE FILELISTONLY to list the logical file names.
    Msg 3013, Level 16, State 1, Line 1
    RESTORE DATABASE is terminating abnormally.
    LVL 51

    Expert Comment

    by:Mark Wills
    The logical filename needs to be the one on the original backup...

    Might be best to use SSMS (sql server management studio)

    from the top...

    in windows explorer (all on the server), create a new folder C:\EE, then in SSMS, create a new database call it EE_TEST put files on C:\EE  -- SSMS will create the names for you - they should be EE_TEST.mdf and EE_TEST_log.ldf go and check in Windows explorer.

    Now right click on that database, go into tasks, then restore, then files. A new pop-up window should appear. Select "From Device" then go into the browse function and ADD your backup file to the empty screen, push OK and you should be back on the Restore window. That file name should appear in the list, and you now need to select it by clicking on the check box.

    Towards the top left of the restore window, there should be a folder called "Options" - click on it and you should now see some details about the backup you have chosen. Now, select the radio button option against overwrite the existing database. Then click on the button next to the "restore as" column. browse to and select c:\ee\ee_test.mdf and same thing for the next row (being the log file). the press OK down the bottom... and it should start restoring.

    Author Comment

    I figured it out. I wasn't using the logical names that the filelistonly gave me.

    Author Comment

    So from SSMS if I had just created a blank db with the same name I might not have had to use the query to restore the db?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now