Tuesday 29 June 2010

Moving SQL Databases

SQL Steps for moving databases to another drive are outlined below. This example is for SharePoint 2007 databases, that are on SQL 2005:

  1. Logon to SharePoint and stop the relevant IIS Website
  2. Logon to SQL, and right click the server name and click Properties
  3. In the dialog box, click Database Settings on the left, and change the default locations for all new databases
  4. Now, right click a relevant database and click Tasks > Detach...
  5. When the box appears, check the exact database and log file names and make NOTES of them
  6. Select the Drop Connection checkbox
  7. Click OK
  8. The database should now dissapear from the left pane
  9. Still on SQL, open Windows Explorer and locate the MDF and LDF files, and copy and paste them to the new drives and make a note of the new location
  10. In SQL Manager, Right click Databases and select Attach and point to the new locations for the MDF and LDF Files
  11. Start the Website in IIS on SharePoint

From here, check the site works. If the pages cannot be displayed, it maybe due to the SQL Database permissions being incorrect. You may need to check to see if there is a DBOwner etc.

There maybe different considerations for databases that aren't for SharePoint 2007.

1 comment:

  1. Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. moving services

    ReplyDelete