Learn how to a build a cloud-first strategyRegister Now


Error when trying to restore SQL 2000 db to SQL 2008

Posted on 2008-11-18
Medium Priority
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
  • 3
  • 2
LVL 51

Accepted Solution

Mark Wills earned 2000 total points
ID: 22991018
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

ID: 22994869
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
ID: 22995123
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

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

Author Comment

ID: 22995314
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?

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

810 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