Migrate Databases from SQL 2005 to SQL 2008 between Virtual or Dedicated Servers

  1. Launch Remote Desktop and Connect to your SQL 2005 based Server; Start > Run > mstsc
  2. rdp

  3. Launch SQL Management Studio, Start > All Programs > Microsoft SQL Server 2005 > SQL Server Management Studio
  4. sql2005launchmanagementstudio

  5. Connect using Windows Authentication
  6. sql2005logon

  7. Expand Databases
  8. Right click on Database you wish to transfer
  9. Select Tasks, Backup
  10. sql2005backup

  11. Note the location of the backup file under Destination
  12. sql2005backupdestination

  13. Click OK to proceed
  14. Click OK
  15. sql2005backupsuccess

  16. Exit from SQL Management Studio
  17. Copy the backup file to SQL 2008 based Server; make note of file location
  18. Launch Remote Desktop and Connect to your SQL 2008 based Server; Start > Run > mstsc
  19. rdp

  20. Launch SQL Management Studio, Start > All Programs > Microsoft SQL Server 2008 > SQL Server Management Studio
  21. Connect using Windows Authentication
  22. sql2008logon

  23. Right click on Databases
  24. Click Restore Database
  25. sql2008restore

  26. Enter the database name in To database:
  27. sql2008databasename

  28. Select From device and Click ...
  29. sql2008fromdevice

  30. Click Add
  31. sql2008specifybackup

  32. Browse to the location of the backup file you previously created
  33. sql2008locatebackupfile

  34. Click OK
  35. sql2008specifybackupselected

  36. Click OK
  37. Select the backup sets to restore
  38. sql2008selectbackupset

  39. Click OK
  40. Your database should be successfully restored
  41. sql2008databaserestoresuccess

  42. Expand Security
  43. Right Click Logins > Select New Login

    sql2008newlogin

  44. Enter a Login name
  45. Select SQL Server authentication
  46. Enter and Confirm Password
  47. Uncheck User must change password at next login
  48. Under Default database select the restored database
  49. sql2008newlogin1

  50. Click OK
  51. Click New Query
  52. sql2008newquery

  53. Select the restored database from the drop-down
  54. sql2008selectrestoreddatabase

  55. In the query window enter the following; be sure to replace userName with the SQL user assocated with this database
  56. EXEC sp_changedbowner 'sa' EXEC sp_change_users_login 'Update_One', 'userName', 'userName'

    sp2008updatequery

  57. Click Execute
  58. sql2008execute

  59. If this executes successfully you should see "Command(s) completed successfully."
  60. sql2008completedsuccessfully

Your database is now fully available on the SQL 2008 server and is mapped to the SQL login specified.