Ever wanted to move a single Site Collection from Content Database A to Content Database B?
Well, the decision is sometimes really easy why to do so. If you are running out of free space in your content database, it may be better to separate the site collections into different content databases. This has something to do with planning your sites and the size you will need, but you also may know that you cannot plan everything in detail.
There are some steps to go through. At first you’ll have to create a new database, then you should move the site collection to the new database und afterwards you should look how to release the space from the old content database. Sounds easy, right? It is so. I make it a little more detailed.
Reminder: It is always better to make a backup before doing such stuff!
Step 1: Create a new Content Database
Go to your central administration and click on Application Management -> Manage content databases.
At the upcoming page please click on Add a content database. Now you will see this screen:
Fill out the necessary input fields and click Ok. Now you created a new Content database which also appears in your SQL Server Management Studio.
Step 2: Move the Site Collection
Now open the powershell of your SharePoint Server and type in the following commands:
<div>Move-SPSite http://servername/sites/sitename -DestinationDatabase yourNewContentDatabaseName</div>
Waiting a while till the command finished. Now the site collection is moved to the new content database. Check if it works.
Step 3: Release the space
If you are looking in your SQL Server Management Studio and watch out for the space of the content databases the new database is filled, but the old one (the source) has the same size. In order to release the space the moved site collection used, you should start the timer job called “Gradual Site Delete“. You find it at central administration – monitoring – Job definitions. Just click to run now and do it maybe two times. Normally that should do the work. I am not sure if this step is really working, but i guess so.
Now you’re done. Hope this helps.
..:: I LIKE SHAREPOINT ::..The article or information provided here represents completely my own personal view & thought. It is recommended to test the content or scripts of the site in the lab, before making use in the production environment & use it completely at your own risk. The articles, scripts, suggestions or tricks published on the site are provided AS-IS with no warranties or guarantees and confers no rights.
He is Consultant for SharePoint Solutions for collaboration, communication and business processes. He provides his customers applications based on standard features as well as development or combining the power of several microsoft tools like Dynamics CRM. In his free time he tries to collect tipps and worthy experience in this blog.