What Happens When You Create a Template

See Also

A team template is a blueprint for a team solution. The template contains all of the information required to create a complete team solution, including the database schema, workflow rules, lookup tables, forms, and views.

When you save a team solution as a template, a new copy of the solution is added to the template directory in the modSystem database.

The Team Template wizard makes it possible for you to provide a template name and description, select any database tables to exclude data from the template, and specify whether existing database users should be excluded from the template.

The wizard then invokes a server COM object (the template management object) to create a copy of the database, truncate the selected tables, remove the database users if desired, and to store a copy or backup of this database into a template components table created for the template. The team Web site (as registered in the modApplications table in the modSystem database) is enumerated, and every file is stored as a template component along with a relative URL to restore it to its original relative location on deployment. The template is added to the templates directory, so it appears in the list of installable templates on the server.

Tip   For an easy way to back up your solution, you can create templates that include all data and all users. Then, by exporting the template to a file, you have a template file that can be used to recreate your solution.

Template Components

Solution Database

In order to truncate user tables and remove database users, a temporary copy of the solution database is made on the server. This database is created in the environment's temp directory. The template manager object runs under the context of the user who invokes it. To succeed at creating the team template, you must be a member of the modAppOwners group.

Web

The template management object enumerates every file in the team Web site and adds them to the template components table along with a URL relative to the team Web root.

Template Information

The template name, title, description, and version information is stored in a new row in the template directory in the modSystem database. If you overwrite an existing template with another that has the same name and version, then the old row in the templates table is deleted, along with its associated template components table.

In addition to this information, the template stores Microsoft SQL Server™ configuration information. When you create a template, the configuration of the server where the template is made is stored in the template. If you deploy the template to a server with different configuration settings, a message will warn you of possible issues.

When developing your solution, it is important to keep these configuration issues in mind. Your development server should have the same configuration as your target servers.