Get the list of Site Collections
- Run the following command to get all of the site collection URL's and
- stsadm -o enumsites -url https://webapplication.url > c:\temp\SiteCollections.xml
This will give you all of the details in an XML file that you need to work with
Generate the STSADM / SQL Delete statements
- Open the XML file in Excel 2010 (it will put everything into columns for you
- Create a new column with the following formula (this is your "Site Collection Delete Script")
- ="stsadm -o deletesite -url " &[@Url] & " -gradualdelete"
- Create a new column with the following formula (this is your "Content DB Delete Script")
- ="stsadm -o deletecontentdb -url https://webapplication.url -databasename " & [@ContentDatabase]
- In this web application we have one Site Collection for each Content Database if you do not you will have to remove non Unique values for this script (or just let it fail)
- Create a new column with the following formula (this is your "DROP Database script")
- ="DROP DATABASE [" & [@ContentDatabase] &"]"
- Your scripts will look like this:
- stsadm -o deletesite -url https://webapplication.url/stuff/eight -gradualdelete
- stsadm -o deletecontentdb -url https://webapplication.url -databasename eight -data
- DROP DATABASE [eight]
I always thought that if you have a multi server farm you had to specify the database server to delete the content database. Turns out you don't.
Run the scripts
- Run the "Delete Site Collection Script"
- Check to make sure you got all of the Site Collections by going to Central Admin --> Application Management --> Content Databases
- Every Content Database should by in a stopped State and have 0 Sites
- Run the "Content Database Delete Script"
- Check to make all the Content Databases have been deleted by going to Central Admin --> Application Management --> Content Databases
- This only detaches the databases from SharePoint! You still have Drop the Databases
- Run the "DROP Database script" (on the SQL Server)
The only thing left to do is delete the Web Application I did that in Central Admin though not using stsadm.
If some one writes a one click decom prodecdure let me know.
No comments:
Post a Comment