Save a copy of your TeamForge site's data to a location from where you can quickly retrieve it to your TeamForge site.
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 9.6, which you want to back up. Replace 9.6 with the PostgreSQL version you run, if required.
  • If you are upgrading by installing TeamForge 19.3 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.
    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.
  3. Stop TeamForge.

    teamforge stop
    
  4. Stop EventQ (if running on a separate server).
    teamforge stop
    
  5. Back up your site data.

    1. Back up the /opt/collabnet/teamforge/var directory.
      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.
      mkdir /tmp/backup_dir/gerrit
      cp -Rpfv /opt/collabnet/gerrit/ /tmp/backup_dir/gerrit
      
    3. Back up the EventQ YAML files and directories if you have EventQ installed.
      cp -Rpfv /opt/collabnet/eventq/config/*.yml /opt/collabnet/mongodb /opt/collabnet/rabbitmq /tmp/backup_dir
      
    4. Compress your backup data.
      cd /tmp
      tar czvf backup.tgz backup_dir
      
  6. Back up the SSH keys, if any.

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

  8. 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
    
  9. 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.

    4. Restore the EventQ YAML files and data directories on the server that hosts EventQ.
      yes | cp -Rf /tmp/backup_dir/*.yml /opt/collabnet/eventq/config/
      yes | cp -Rf /tmp/backup_dir/mongodb /opt/collabnet
      yes | cp -Rf /tmp/backup_dir/rabbitmq /opt/collabnet
      

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/9.6
    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