Manage Learn to apply best practices and optimize your operations.

How to copy databases when upgrading to SQL Server 2005

Learn how to copy databases when migrating from SQL Server 2000 to SQL Server 2005, and how to transfer logins.

I am trying to migrate from SQL Server 2000 32-bit with close to 300 databases, to SQL Server 2005 64-bit. I have tried the "Copy Database" feature but it fails to copy any database over. I also need all of the logins moved over. I am open to any suggestions.
I generally find that the Copy Database Wizard is slow and inefficient compared with other methods of moving data. It is best used for cases when you need to do a very quick and dirty transfer of a small amount of data between a couple of servers, and don't want to take the time to do a backup or detach the database.

If you need to move 300 databases, I think you'll discover that the fastest way is to use sp_detach_db on the SQL Server 2000 instance to detach each database and sp_attach_db to re-attach the databases on the SQL Server 2005 instance. Doing so also has the benefit of preserving your database users.

However, even with that method you'll still have to get the logins into the SQL Server 2005 instance. To access a KB article, which includes a script that should help you with that task, see this Microsoft support page.

Note that you might have to re-map the logins to database users once you're done. To do so, use the sp_change_users_login system stored procedure.

Dig Deeper on SQL Server Migration Strategies and Planning

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.