How to move SharePoint Content Databases between different storage media within the same SQL Server

This was a solution that I came across when this client of mine needed to free up some space on his SharePoint test environment.

He was running a VM Ware setup and he had run out of space on the C: drive wherein his SQL server was holding his DB files.

I was able to create new drives on the VMWare SQL server wherein the DB files will be kept. Then I created an empty DB (stats_db). This was an “insurance policy” that I wanted to use just in case I loose the site collections if I had to move the content database.


  1. Create a new drive or identify your new storage media.
  2. In the SQL database create a new database from the Microsfot SQL Server Management Studio.

Right click on Database and select New Database, name it “New_db”

  1. Goto the SharePoint Central Admin >Application Management > Content Databases> and add this database as a content database to the web application you will be moving its content database.

Add the “New_Db” to the Database name and click OK

  1. Remove the old/previous content database.

  1. Then detach the old/previous content database from the SQL server.

  1. Copy the detached Db files (LDF & MDF)to the new media storage.
  2. Reattach the Content database from the new location

Browse to the new location and attach the copied database.

  1. Add the newly attached Db to the web application just like you added the “New_Db”.
  2. Do iisreset.
  3. Test the web application and voila! – this works

No comments: