In this post I will go cover the creation of a site using the STSADM tool. If you want to clone a few sites and re-create several copies of them this is the easiest way to do it. This is really handy if you have a base Project Management or Team Site that you want to use for a few different areas of your business!

STSADM Export - Exporting the base site

The first step of the process is to create a "template" for us to re-use when creating the copies. To do this we use the STSADM -o export command. Below is the syntax to do this. As always, I put this into a batch file so I have to change the directory to the 12 hive so I can run STSADM.

   1: cd %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\12\bin 
   2: REM Export the base site to a folder on the file system
   3: stsadm -o export -url http://yoursite/demosite/ -filename c:\SiteBase\ -includeusersecurity -versions 4 -nofilecompression -quiet 

Creating the Site and Importing the base template

The next part of the process is to create a base site and then import the "template" we exported above.

Note: Make sure you use the same site template for the createweb command as you used to create the base template! not doing so will cause an error and the import process will not work.

Below is the syntax to create the site and import the exported "template".

   1: cd %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\12\bin
   2: REM Create a site base
   3: stsadm -o createweb -url http://yoursite/NewSite -title "Demo Site Name" -sitetemplate STS#0 
   4: REM Import the template we exported 
   5: stsadm -o import -url http://yoursite/NewSite -filename c:\SiteBase\ -includeusersecurity -nofilecompression -quiet 

Now that we have this we can reproduce it to create multiple instances of the same site!