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)?
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.
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.
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:
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
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.
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:
Backup original site - stsadm.exe -o backup -url http://sitename -filename E:\SP_Original_Backup.bak -overwrite
Backup 12 hive - %CommonProgramFiles%\Microsoft Shared\web server extensions\12
Backup wss folder - %SystemDrive%\Inetpub\wwwroot\wss
Restore site on another server - stsadm.exe -o restore -url http://newsitename -filename E:\SP_Original_Backup.bak
Restore 12 hive
Restore wss folder
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.