Icon

You are viewing the documentation of TeamCity 10.x and 2017.x, which is not the most recently released version of TeamCity.
View this page in the latest documentation or refer to the listing to choose the documentation corresponding to your TeamCity version.

 

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

(info) This document describes some of the maintainDB options. For a complete list of all available options, run maintainDB from the command line with no parameters.

Performing full restore

TeamCity backup file does not contain build artifacts, so for the full restore you need to restore settings and database from the a backup file (at least settings and database) and copy the build logs and artifacts (located in <TeamCity Data Directory>/system/artifacts by default) that were not included into the backup form old into the new data directory manually. See also details on the directories in the TeamCity Data Directory description.

Performing full restore

To perform restore from a backup file:

  1. Install the TeamCity server from a tar.gz or .exe installation package. Do not start the TeamCity server.
  2. Create a new empty TeamCity Data Directory.
  3. Select one of the options:
    1. To restore the backup into a new external database, create and configure the an empty database, placing the configure a temporary database.properties file  (this is a temporary file for the purposes of restore) into any directory other than the TeamCity Data Directorywith the database settings to be passed to the "restore" command later on.
    2. To restore the backup into the internal database, save the code below to the database.properties file  (this is a temporary file for the purposes of restore) and place the file into any directory other than TeamCity Data Directory:

      Code Block
      # Database: HSQLDB (HyperSonic) version 2.x 
      connectionUrl=jdbc:hsqldb:file:$TEAMCITY_SYSTEM_PATH/buildserver
      
  4. Place the required database drivers into the lib/jdbc sub directory of the newly created Data directory.
  5. Use the maintainDB utility located in the <TeamCity Home>/bin directory

    .

    Use the restore to run "restore" command:

    Code Block
    maintainDB.[cmd|sh] restore -A <absolute path to the newly created TeamCity Data Directory> -F <path to the TeamCity backup file> -T <absolute path to the database.properties file of the target database>
  6. If the process completes successfully, copy over <TeamCity Data Directory>/system/artifacts from the old directory

 

Restore command options:

 

  • The -A argument can be omitted if you have the TEAMCITY_DATA_PATH environment variable set.
  • The -F argument can be an absolute path or a path relative to the <TeamCity Data Directory>/backup directory.
  • The -T argument should point to the temporary database.properties file created in step 3.

...