views:

8889

answers:

4

Is it possible to restore a backup of a SQL Server 2005 database onto an instance of SQL Server 2008?

I need to rebuild a server as it's getting rather crufty, so I plan to take this opportunity to upgrade to SQL 2008 and wondered if I'll be able to restore my backups OK.

+3  A: 

Upgrading from 2005 to 2008 is OK, moving back might require more work

N.B. You might have a problem with your database the logins (as they will not exist in the new server master db) but that's something which would happen regardless of the server version. Just re-create them and re-associate with your database.

Ilya Kochetov
Thanks Ilya.Ah yes, I'm intimately familiar with the joy of fixing orphaned users. Thanks for the reminder.
Ian Nelson
+1  A: 

You can restore the 2005 backup with 2008 without any problems. The compatibility from this point of view is nice.

Backward is not possible only with backup files.

In any case you can also recreate the database structure and use SSIS to transfer data from one server to another.

Biri
+4  A: 

Yes, but make sure that ALL of your servers are SQL 2008. If you have development, test, QA or disaster recovery servers, all of them will need to be 2008, since 2005 servers won't be able to restore a 2008 backup.

To prevent the lost-login problem that Ilya mentioned, follow the steps in this knowledge base article. SP_Help_Revlogin will script out your logins, and you can apply that script on the new server. Presto, all your logins are back with the same SIDs and everything.

http://support.microsoft.com/kb/246133

(And just for future reference, this is how we upgraded StackOverflow last night, heh.)

http://twitter.com/SuperDalgas/status/976719756

Brent Ozar
A: 

You can also do a detach/attach with the database files (leastways you could going from 2000 to 2005), but there are more caveats with this approach (requires explicit rebuild indexes afterwards IRRC)

piers7