How to Backup StarTeam Server



How to Backup StarTeam Server


Information in this Brief applies to:

  • StarTeam 3.x, 4.x
  • Windows 95, NT, 2000


As you create server configurations the StarTeam server creates files and directories for you to hold your configuration and project information. To properly backup StarTeam project data, it is necessary to backup all data at the same time. In addition, no one should be adding or changing project data when the files are being backed up. The files should be backed up regularly and multiple backup copies maintained. The Repository Tools=>Verify that was added with StarTeam 4.1 also relies on the cache, which you may also want to include in the backup.

The files and directories to backup include:

The Configuration and cipher files:

Database files:
Database\StarTeamDB.mdb (Assuming Access database)

Archive dir: *.*
Attachments dir: *.*

Cache dir: *.*

The StarTeam Administrator"s Guide (Appendix C, "Backing Up StarTeam") describes the proper backup process. It cannot be emphasized enough that the database and the StarTeam repository must be backed up in synchronization. If the StarTeam file repository and the StarTeam database are backed up at different times, and users have accessed StarTeam between those two times, the repository and the database will not be synchronized. This is a situation which can easily occur using databases such as MS SQL or Oracle, which often times run on completely separate machines than the StarTeam VirtualTeam Server, and may be on their own backup schedules. Restoring out-of-sync repositories and databases will cause operational problems in StarTeam. Even though there is a vault verification utility that can be run to resynchronize the database with the repository, there will be some inevitable data loss. To avoid this scenario, you should do one of the following to ensure a synchronized backup:

  • Lock the server for the duration of the entire backup using either the StarTeam command line or server administration tools
  • Shut down StarTeam VirtualTeam Server


In order to make sure the StarTeam server is not accessed by a user while performing a back up, you can use the StarTeam commandline (stcmd) to temporarily lock the server while the back up is being performed. You can then schedule this process by using the AT command line.

You can use stcmd servermode to lock and unlock a server, assuming you have administrative privileges. Locking a server limits server access while you perform backup or other procedures. When the server is locked, only server administration commands are accepted. When you unlock the server, normal operations resume. The user in the following example is assumed to be an administrator.

The syntax of the lock command is:

stcmd servermode [/pwdfile "fileName" ] [/cmp ] [/encrypt encryptionType ][ /q ] [/x ] /s "serverName" /mode[ lock | unlock]
The following example uses stcmd servermode to lock the server using port 1024 on Orion.

stcmd servermode /s "JMarsh:password@Orion:1024" /mode lock

Instructions for setting up an automated lock process for the StarTeam Server (using the above example as a reference):

1. Create a batch files to lock and unlock the StarTeam Server. (See sample below)

Lock Server Batch File (LockServer.bat)

stcmd servermode /s "JMarsh:password@Orion:1024" /mode lock

Unlock Server Batch File (UnlockServer.bat)

stcmd servermode /s "JMarsh:password@Orion:1024" /mode unlock

2. Start the NT Scheduler Service in the control panel.

In addition, no matter what method you choose to use, you will want to make sure that you back up the following files and directories to safely restore your server. And most important, do NOT forget to write down your cipher key!

Config files:

These files are created when you create your repository. They are not stored, however, with the repository. You will want to make sure you have a copy of these files in order to re-create your installation of StarTeam. The file names are:


Where "server" is the name of your StarTeam Server name. They are typically stored in a sub-directory of the StarTeam install called config, but that location can be changed by the user. You may want to search your hard drive and find all instances of *.scg and *.cph. These files are very important.

Database files:

Most of your information is stored in a subdirectory called the repository. The repository path for your server config can be found by running the server configuration dialog and clicking on Vault. These three directories, and all their files must be backed up:

Archive\ *.*
Attachments\ *.*

Finally, make sure you backup the StarTeam database file, also stored in the repository. This file is in the same repository path, usually in a sub-directory called database, and in the case of Access, called StarTeamDB.mdb.

Create a batch file to copy the repository to a backup directory
Assuming the Vault, Archive, and Attachments are located within the same directory, use the following command in your batch file


For example, (where C:\MyRepository = Repository Directory and D:\BACKUP = Backup Directory)

XCOPY C:\MyRepository D:\Backup /E

Scheduling the backup commands
1. Start the NT Scheduler Service in the control panel.
2. At the Command Prompt, use the AT command to setup the scheduled Lock process.

AT command sample
C:\>AT \\ComputerName 00:00 /Every:M,T,W,Th,F C:\STPBatchFiles\LockServer.bat
C:\>AT \\ComputerName 01:00 /Every:M,T,W,Th,F C:\STPBatchFiles\UnlockServer.bat

3. Schedule the backup to be performed approximately 30 minutes after the lock command is executed.

How to create a database backup (Using MS SQL Enterprise Manager)
To create a database backup:

1. Expand a server group; then expand a server.
2. Expand Databases, right-click the database, point to All Tasks, and then click Backup Database....
3. On the General tab, in Name, enter the backup set name.
4. Optionally, in Description, enter a description of the backup set.
5. Under Backup, select Database - complete.
6. Under Destination, click Add... to add an existing or create a new backup device, or click Remove to remove a backup device from the list of backup devices to be used.
7. In the SQL Server Backup dialog box, under Overwrite, select:
  • Append to media to append the backup to any existing backups on the backup device.
  • Overwrite existing media to overwrite any existing backups on the backup device.

8. Select Schedule to schedule the backup operation for the later periodic execution.

NOTE: There are two additional files that are also required to restore a repository and should be backed up. The files (assuming the default is maintained) are located in Config Files directory and have the extension .scg and .cph. The config files directory can be located in the StarTeam Virtual Team Server installation directory. These files are mostly static, so they only need to be copied periodically. The .scg file is used when the StarTeam Server is in use, so this procedure must be done when the server is not running. Copy the .scg and .cph files into the repository directory so they will be backed up along with our repository directory.

Technical Brief: 10/29/01

Old KB# 28425
Comment List