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.
- Create a new drive or identify your new storage media.
- 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”
- 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
- Remove the old/previous content database.
- Then detach the old/previous content database from the SQL server.
- Copy the detached Db files (LDF & MDF)to the new media storage.
- Reattach the Content database from the new location
Browse to the new location and attach the copied database.
- Add the newly attached Db to the web application just like you added the “New_Db”.
- Do iisreset.
- Test the web application and voila! – this works