Moving site collections between Content databases with a single command

When I first heard about it, I had to test the simplicity to do this with the new stsadm option that was inserted in the latest security hotfix for WSS of October 9th. This command is not very well documented anywhere. I herad about it by Todd Klindt in one of his TechEd sessions last week and tested it today. I must say it works like a charm.


This is the command: 


stsadm.exe -o mergecontentdbs
           -url <url>
           -sourcedatabasename <source database name>
           -destinationdatabasename <destination datbabase name>
           [-operation <1-3>
                1 – Analyze (default)
                2 – Full Database Merge
                3 – Read from file]
           [-filename <file generated from stsadm -o enumsites>]


See also:
     stsadm -o enumcontentdbs -url <url>
     stsadm -o enumsites -url <url> -databasename <database>


The way this is to be used as suggested by Todd is, to use a file with the site collections you want to move. As you can see above this file can be generated by the stsadm -o enumsites command. All you need to do then, is open up the file and remove the lines with the site collections you do not want to move. Save the rest and feed it to the new command.


e.g. C:\stsadm -o mergecontentdbs -url http://wss -sourcedatabasename WSS_Content_7fc30dd3c1514cdda6b68bd8d10a0463 -destinationdatabasename WSS_Content -operation 3 -ilename sites.txt


So, I hope you enjoy this cool new command and use it !


Update 20 Nov ’07: Todd has finally found the time to publish his article about this as he promised at TechEd. Go check it out @ http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=53

Administering Microsoft SharePoint Products and Technologies 2007 Using STSADM

Finally, the last session of the day with Todd Klindt showing his magic with stsadm, the command-line administration tool for SharePoint.


The slides?  You guessed it, attached to this post as usual [8-|]


My notes during the session:




  • Template picker: ever wanted to have your users select the website template themselves the first time they connect to the site collection? Well you can. All you need to do is create the site collection using stsadm without specifying a template. This way the first time you connect to the site collection you will get the same dialog you get for creating a new site, allowing you to specify a site template.


  • Site Delete Capture tool: captures sites to disk before they are deleted from the Content Database


  • Always restore sites into a empty site. The restore operation does not overwrite content already present in the site, causing duplicate entries, etc.


  • when exporting sites, the files are actually CAB files. So, rename them to cab files and you can simply double-click the file to open it and view / export data directly

And now for Todd’s famous ‘Grand Finale’: move a site collection from one contentdb to another contentdb in a single command:


stsadm -o mergecontentdbs  -> this new command was snuk in in one of the last hotfixes by Microsoft and allows you move a site collection to a different contentdb.


Explore it and test – test  – test !


There is another great article out there: powerful command line administration for SharePoint @ http://www.microsoft.com/technet/technetmag/issues/2007/01/CommandPrompt/

HP ProLiant Sizer for Microsoft Office SharePoint Server 2007

HP has made a tool available to do some sizing for a MOSS environment. I have seen this tool in action on TechEd and I must say that it is a pretty neat piece of software. It asks you some questions about your environment (number of users, expected load, do you want high availability, etc.) and it comes up with a MOSS configuration that can be saved and updated later on. In addtition to that, being a HP tool, it gives you an overview of the necessary hardware you will need with current HP prices. This way you can easily show any manager what their requested configuration will cost very quickly, when they come to you with their big dreams of SharePoint, slamming them right back to reality [:D].

The tool can be downloaded from: http://h71019.www7.hp.com/activeanswers/Secure/548230-0-0-0-121.html  (login required)The description that is published on the site for this tool is:




The HP ProLiant Sizer for Microsoft Office SharePoint Server 2007 is an automated tool that provides a quick and consistent methodology to determine a “best-fit” server for your individual needs and enables you to both quickly compare different solution configuration (what-if scenario) and also to obtain a highly detailed, customizable server and storage solution complete with bill of materials and pricing.

·         It also addresses one of the most critical areas of Office SharePoint Server 2007 server design, performance and capacity planning for the storage subsystem. The storage sizing and configuration capabilities provide detailed best-practice storage volume and RAID recommendations to support the database and content storage needs, using HP direct-attach storage, HP StorageWorks MSA, or EVA Storage SAN solutions. ·         The tool solicits data or uses built-in defaults to determine the optimum solution, based on the Office SharePoint Server 2007 best-practice configurations and supported growth paths.  The default configurations that can be selected include an entry level solution, highly available solution, and an application optimized solution.  The tool’s “what if” feature allows very rapid comparison of the effects of workload changes, platform choices with respect to solution deployment, server capacity utilization, estimated network traffic. You will be allowed to select a configuration and customize for your particular environment, by adding or substituting components. ·         The HP ProLiant Sizer for Microsoft Office SharePoint Server 2007 was developed based on knowledge gained during extensive performance characterization of Microsoft Office SharePoint Server 2007 in the HP Solution Alliances Engineering performance labs in Nashua NH.  It builds on HP’s collaboration with Microsoft and the Office SharePoint Server performance whitepapers available from HP Active Answers.

Simple SharePoint Warm Up Script (by Kirk Hofer)

This handy litlle powershell script has been grabbed from Kirk Hofer’s blog @ http://blogs.inetium.com/blogs/khofer/



Finally, my first post is finally in a working state…here we go:


For those of you who have to schedule those IISRESETs on your servers to clean memory and then do not want the time it takes the end user to hit the site and warm up the ASPX pages, here is a PowerShell script that is much to the liking.  I have seen others done in VBScript, but this is way cooler:

############################################################################
#Assumptions:
#-Running on machine with WSS/MOSS
#-C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN in path
############################################################################

$output=stsadm -o enumzoneurls
$x=$output
$x.ZoneUrls.Collection|
foreach-object -process {$y=stsadm -o enumsites -url $_.Default;$sites=$y;$sites.Sites.Site}|
foreach-object -process {write-host $_.Url; $html=[System.Net.WebRequest]::Create($_.Url);}


That is it, nothing else too crazy about this one.  It loops through all the web applications and then site collections and hits them all.  If you like PowerShell, and you know you do now…this is the icing…enjoy!


I know what a bitch it is to copy/paste code from some blogs and I know it is the same here [:$].


That’s why you can find the script in a text file attached to this post

SharePoint Governance and Manageability Tools

There are a few tools that have been posted on codeplex, that are worth using or at least exploring:



  • Microsoft IT Site Delete Capture 1.0 – Simply captures sites that are deleted by end users and backs them up to disk using the event model. You have a recycle bin, but this is basically a site recycle bin (available only to administrators). (Works with WSS 3.0 and Office SharePoint Server 2007)

  • MS IT Site Life Cycle Management 1.0 – Notify, Backup then Delete Unused Unneeded sites (Works with WSS 3.0 and Office SharePoint Server 2007)

 



  • MS IT Usage Reporting Framework 2.0 – Simple reporting framework to gather usage and storage metrics on WSS 3.0, MOSS 2007 and works with multiple farms. Note the caveats with SQL read queries listed on the framework homepage (direct select statements against the database).

As mentionned , these tools can be found on codeplex @ http://www.codeplex.com/governance


 

SharePoint Asset Inventory Toolkit

While attending TechEd’s session OFF209_SharePoint Governance and Information Architecture Guidance by Joel Oleson and assisted by Shane Young there was a talk and demo for the SharePoint Asset Inventory Toolkit. This product was announced in Beta.


Basically, this product can be installed on a standalone laptop that you can connect to a customer network to scan the existing SharePoint infrastructure in place.


After check Jole’s blog, there are apparently 3 new tools for SharePoint that are announced in Beta.


Read all about them on Joel’s Blog @ http://blogs.msdn.com/joelo/archive/2007/08/18/three-new-sharepoint-solution-accelerator-programs.aspx

StsadmWin: the Windows GUI for STSADM

One of the most frequently used utilities in SharePoint (2007 as well as 2003) is STSADM.Although highly improved in 2007, it maintains backward compatible with 2003 syntax.


As STSADM is a command line utility, and the command-line is somewhat limited compared to Windows GUI, especially when it comes to non-English usage, there is a room for GUIs like stsadmWin (STSADM for Windows).


Read all about it on Ronalus’ Blog at:


http://blogs.msdn.com/ronalus/archive/2007/01/04/stsadmwin-has-an-2007-version.aspx