• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1457
  • Last Modified:

Error when trying to restore SQL 2000 db to SQL 2008

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)
0
biotec
Asked:
biotec
  • 3
  • 2
1 Solution
 
Mark WillsTopic AdvisorCommented:
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 :

RESTORE DATABASE TestDB
   FROM AdventureWorksBackups
   WITH  MOVE 'AdventureWorks_Data' TO 'C:\MySQLServer\testdb.mdf',
              MOVE 'AdventureWorks_Log' TO 'C:\MySQLServer\testdb.ldf';
GO
0
 
biotecAuthor Commented:
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.
0
 
Mark WillsTopic AdvisorCommented:
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.
0
 
biotecAuthor Commented:
I figured it out. I wasn't using the logical names that the filelistonly gave me.
0
 
biotecAuthor Commented:
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?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now