1

I have a site that I'm building a test environment for and I need to "copy" the whole setup to another server.

In that process I need to copy some templates and the question is: How do I do that (I can find e.g. the site template folder on the production server, but copying the files is not enough)?

1
  • Most sources I find refers to stp files for installing templates but how do I get that file from the template folder? I can find a folder for each templae containing a default.aspx file an a folder named XML containing a onet.xml file
    – noesgard
    Sep 23, 2009 at 8:21

6 Answers 6

1

I'm surprised nobody mentioned this but why not create a custom site definition. Site definitions can be wrapped in a SharePoint solution file, making it a reproducable, simple process to deploy your template. A site definition can contain anything you want deployed, from lists to site templates to .aspx files to .doc etc. etc. It is all written in declarative CAML. (and features you can activate automatically in either the onet.xml or by using Feature Stapling, if needed executing featurereceivers in the process).

When using a site definition you create a base on which you then build your website. On my current project all files needed for initial deployment are in the solution, when the server (yes it is a sharepoint + sql box only deployment) goes bust I just roll out the solution to a new server and reattach the content database and we're up and running again in 10 minutes.

1

Copying the files in 12\TEMPLATE should do the trick, assuming the "templates" you are talking about are site definitions.

You'll need to do an IIS reset on the server you copy to once the files have been copied.

Usually site definitions are "site collection templates," so you would see them when adding a new site collection. If they are "site templates" you'll see them when adding a new site.

There are no .STP files involved with site definitions.

Best practice is to package and deploy a site definition as a solution as this simplifies the process.

0

As far as I know all the templates (for sites and lists) are kept inside SharePoint database and there is no folder you can copy these from. (There STSADM command to export all templates I am not aware of)

In cases like this one we usually backup the entire collection and restore it to production (in case your test site looks and feels like as production site should). The other option might also be backing up just SQL database of test site and attaching it to your production site.

0

You also have to add them to your sharepoin site. This can be done with the stsadm command. If you don't have this tool you can download it at http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c1039e13-94da-4d7d-8cae-3b96fa5a4045

Then you will have to do the following:

  1. Log in to target SharePoint server
  2. Copy site template to SharePoint server
  3. Use this command to add template: Path to STSADM If you do not have the path for STSADM set, you will have to change your prompt location to be C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

stsadm -o addtemplate -filename -title [-description ]

Example:

stsadm -o addtemplate -filename c:\template .stp -title "This is what people see" -description "Short description of purpose of template"

You will be prompted to do an iisreset to complete the template installation. Once iisreset is complete login to a web site create a new site and under "Custom" tab for "Template Selection" you should see your new template as an option

This should do the trick ;)

For a full explenation of the stsadm tool you can consult http://technet.microsoft.com/en-us/library/cc288981.aspx

If you want to copy the whole sharepoint configuration do the following:

Make a full backup of your MOSS. You can do this with the following command.

stsadm.exe –o backup –directory “C:\Backup_SharePoint” –backupmethod full

After this you can restore this to your test.

Start the "Windows SharePoint services Administration" service manually. (if this is not done the restore will generate 3 error messages) stsadm.exe -o restore -directory "C:\Backup_SharePoint" -restoremethod overwrite

2
  • I just dont see the stp file for the templates anywhere... Where are they located? I just copied the content of the site template folder for the templates in question
    – noesgard
    Sep 23, 2009 at 8:06
  • @Bob, could you combine your two answers into one, and delete the 'redundant' one? Both of them look quite helpful, and together, I'm sure they'd be mroe so :)
    – warren
    Sep 23, 2009 at 10:49
0

I've made replica test environments of a production Sharepoint environment a few times, however, it was in the case of a single SP server. I found that I need to backup/restore some file-level stuff, too.

Here's what I did:

  1. Backup original site - stsadm.exe -o backup -url http://sitename -filename E:\SP_Original_Backup.bak -overwrite

  2. Backup 12 hive - %CommonProgramFiles%\Microsoft Shared\web server extensions\12

  3. Backup wss folder - %SystemDrive%\Inetpub\wwwroot\wss

  4. Restore site on another server - stsadm.exe -o restore -url http://newsitename -filename E:\SP_Original_Backup.bak

  5. Restore 12 hive

  6. Restore wss folder

0

There are a number of ways to do this. Be sure you choose a supported method so you don't have a nightmare upgrading to 2010 when you get around to it

http://support.microsoft.com/kb/898631

Look at the first option for creating your own site definition.

I don't think you want to copy the whole server over, I think you want to package up your changes and deploy them as features on the production server. Please note this is not coming from an experienced voice, but this is our plan when we finally customize our install.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .