Question

I've been beating myself over the head with this app migration for a few days now. What I have is an old MSSQL Server 2000-backed application that is being upgraded to a Windows 2003 Server running SMSQL Server 2005. I know little about SQL Server but obviously not enough.

I tried backing up the database on the old server by going to Databases->[Database]->All Tasks->Backup Database..., selecting 'Full', and saving the file. I moved that backup file to the new server and tried to do a restore but it complained saying that it was looking for the [Database].mdf file in the location it was on the old server.

So then I tried to do an Export Data, selected the local SQL 2000 database, pointed it to the new SQL 2005 database on the other machine, and it gets all the way to the end and dies complaining about the way one of the tables is being joined.

I tried then doing a 'Generate SQL' command on the 2000 box and running that under SQL 2005. It looks like there are a lot of outer joins using the old *= syntax that SQL Server 2005 doesn't support anymore and, this being a vendor database, have no idea what their true intentions were when they set up these tables.

Is there any other way I can try migrating this database over?

Was it helpful?

Solution

The backup file has the "hard" location of the data files stored in it. You just need to update them:

When you restore in 2005, before you click the final "ok" to restore (after you have selected the .bak file), go to the options tab. This will have the mdf and ldf locations that were in the backup file. Change these to legitimate directories on your new machine.

OTHER TIPS

You could detach the database from the old server, copy the mdf and ldf (and any other related files) to the server server, and then attach the database to the new server.

When you attach it, SQL Server will upgrade this to a 2005 formatted database. If you have problems with compatibility, you can change that, too. In SQL Server Management studio, Right click your database, click properties, click Options, and change the compatibility mode to 'SQL Server 2000 (80)'.

As Peter noted, you have to change the path to a new one that exists on the new server.
This picture will help:

restore

One trick I learn years ago is to click the last option button ("Leave the database in read-only ...") for a minute to view and copy where the data files are located in the new server. Just don't forget to put it back to the first option before restoring

Create a backup of SQL2000's database to file. Create new database on SQL2005 with same name and restore backup file into new database with option "force restore over existing database" and set copliant level of new database to "SQL2000 (8.0)".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top