Wednesday, December 8, 2010

Moving SharePoint Content database from one drive to another on same server

Hello friends

Before some days my c: drive becomes full so I decided to move the all SharePoint content database files from c: drive to D: drive , how to do that?

Let us see step by step procedure
  1. Run DBCC CHECKDB command first to check there are no consistency errors on the content database or not.
  2. For safer side take the backup of content database before you start the moving process. You can take the backup of any SQL Database by following this method.
  3. Go to ->Microsoft SQL Server Management studio -> Databases->Content Database->Task->Backup
  4. Right click SharePoint database name, select Tasks -> Detach. Check Drop connection if there are active connections.
  5. Using Windows Explorer, copy the existing Primary Data File, Secondary Data File, and Transaction Log from location on C(old) drive and Paste these files into new folder on D(new) drive
  6. Run following command in query windows.
  7. use master
    EXEC sp_attach_db @dbname = N'WSS_Content_DatabaseName',
    @filename1 = N'D:\MSSQL\Data\WSS_Content_DatabaseName.mdf',
    @filename2 = N'D:\MSSQL\Data\WSS_Content_DatabaseName.ldf'
  8. Run DBCC CHECKDB command again to check there are no consistency errors on the content database after moving. Query message should show 0 allocation errors and 0 consistency errors.
  9. Make sure that SharePoint application is running properly after content database move.
  10. Done.
Disha Shah

No comments:

Post a Comment