Skip to main content
Version: TeamForge 23.0

Back up and Restore TeamForge

Before You Begin
  • The following instructions, though applicable in general to any PostgreSQL version, assume that you run a TeamForge version that runs on PostgreSQL 11.12, which you want to back up. Replace 11.12 with the PostgreSQL version you run, if required.
  • If you are upgrading by installing TeamForge 23.0 on new hardware, then you'll need the backed-up site data to complete the upgrade.
  • If you are upgrading your site on the same hardware, then you won't need to back up but you should create a backup anyway, as a measure of caution.

Back up and Restore TeamForge Database, Data Directories and site-options.conf

  1. Log on to the TeamForge server that you want to back up.

  2. SOAP 50 is no longer supported. Back up all your custom event handlers and remove all the event handler JAR files before starting your TeamForge upgrade process.

tip

Do this on the TeamForge Application Server.

  1. Go to My Workspace > Admin.

  2. Click System Tools from the Projects menu.

  3. Click Customizations.

  4. Select the custom event handler and click Delete.

    tip

    Post upgrade, you can add custom event handlers again from the backup while making sure that you don't have SOAP50 (deprecated) library used.

  5. Stop TeamForge.

    important

    Stop TeamForge on all the servers in a distributed setup.

    teamforge stop
  6. Back up your site data.

    1. Back up the /opt/collabnet/teamforge/var directory.

      tip

      Do this on both the TeamForge Application and Database servers in case you have them running on two separate servers.

      mkdir -p /tmp/backup_dir
      cp -Rpfv /opt/collabnet/teamforge/var /tmp/backup_dir
    2. Back up the /opt/collabnet/gerrit directory if you have Git integration.

      tip

      Do this on the server that hosts the TeamForge—Git integration services.

      mkdir /tmp/backup_dir/gerrit
      cp -Rpfv /opt/collabnet/gerrit/ /tmp/backup_dir/gerrit
  1. Compress your backup data.

    cd /tmp
    tar czvf backup.tgz backup_dir
  2. Back up the SSH keys, if any.

  3. Back up your SSL certificates and keys, if any.

  4. If you are upgrading TeamForge on new hardware, copy the backed up data and the site-options.conf file to the new server.

    scp /tmp/backup.tgz username@newbox:/tmp
    scp /opt/collabnet/teamforge/etc/site-options.conf username@newbox:/tmp
  5. Restore the TeamForge data.

    1. Log on to the server where you want to restore the data and unpack the backup.tgz file.
      cd /tmp
      tar xzvf backup.tgz
    2. Restore the database and data directories.
      cp -Rpfv /tmp/backup_dir/var /opt/collabnet/teamforge/
    3. Restore the Git data directories on the server that hosts TeamForge—Git integration.
      cp -Rpfv /tmp/backup_dir/gerrit/gerrit/etc /opt/collabnet/gerrit
      cp -Rpf /tmp/backup_dir/gerrit/gerrit/.ssh /opt/collabnet/gerrit
      cp -Rpf /tmp/backup_dir/gerrit/gerrit/bin /opt/collabnet/gerrit
      cp -Rpf /tmp/backup_dir/gerrit/gerrit/index /opt/collabnet/gerrit
      mv /opt/collabnet/gerrit/box-<gerrit source server hostname> /opt/collabnet/gerrit/box-<TeamForge 19.1 gerrit server hostname>
      here, <gerrit source server hostname> refers to the hostname of the server on which gerrit was hosted.

Back up and Restore the Review Board Database and Data Directories

If Review Board and TeamForge are co-hosted on the same server, the Review Board database and data directories should have been backed up already when you backed up TeamForge. So, it is not necessary to take a back up of the Review Board database and data directories again. However, you must back up Review Board if you have Review Board on a separate server outside of the TeamForge Application Server.

  1. Back up the /opt/collabnet/teamforge/var/pgsql and /opt/collabnet/teamforge/var/reviewboard/data directories from the Review Board Server that hosts the Review Board database service (reviewboard-database) in case you have Review Board on a separate server outside of the TeamForge Application Server.

    mkdir -p /tmp/backup_dir
    cd /opt/collabnet/teamforge/var
    tar -zcvf /tmp/backup_dir/reviewboard_pgsql.tgz pgsql/11.12
    tar -zcvf /tmp/reviewboard_data.tgz reviewboard
  2. Copy the /tmp/reviewboard_pgsql.tgz and reviewboard_data.tgz files to the /tmp directory of the new server if you are upgrading Review Board on a new hardware.

    scp /tmp/reviewboard_pgsql.tgz username@newRBbox:/tmp
    scp /tmp/reviewboard_data.tgz username@newRBbox:/tmp
  3. Restore the Review Board database and data directories (on the new server where you plan to have the Review Board database).

    cd /opt/collabnet/teamforge/var/
    tar -zxvf /tmp/reviewboard_pgsql.tgz
    tar -zxvf /tmp/reviewboard_data.tgz

Back up and Restore TeamForge Data Using the teamforge.py Script