How to copy databases when upgrading to SQL Server 2005

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.

    Requires Free Membership to View

    By submitting your registration information to SearchSQLServer.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSQLServer.com is governed by our Terms of Use. You may contact us at [email protected].

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.

This was first published in May 2006

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.