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.3, which you want to back up. Replace 9.3 with the PostgreSQL version you run, if required.
  • If you are upgrading by installing TeamForge 18.2 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.

    • If you are upgarding from TeamForge 16.7 or earlier releases:
      /etc/init.d/collabnet stop
      
    • If you are upgrading from TeamForge 16.10, 17.1, or 17.4 releases:
      /opt/collabnet/teamforge/bin/teamforge stop
      
    • If you are upgrading from TeamForge 17.8 or later releases:
      teamforge stop
      
  4. Stop EventQ.

    • If you are upgrading from TeamForge 16.3:
      /etc/init.d/orchestrate stop
      
    • If you are upgrading from TeamForge 16.7, 16.10, or 17.1 release:
      /etc/init.d/eventq stop
      /etc/init.d/collabnet-rabbitmq-server stop
      /etc/init.d/collabnet-mongod stop
      
    • If you are upgrading from TeamForge 17.4 release:
      /opt/collabnet/teamforge/bin/teamforge stop
      
    • If you are upgrading from TeamForge 17.8 or later releases:
      teamforge stop
      
  5. Back up your site data.

    On sites running TeamForge 16.7 or earlier versions:

    1. Back up your site database.
      mkdir -p /tmp/backup_dir
      cd /var/lib
      tar -zcvf /tmp/backup_dir/pgsql.tgz pgsql/9.3
      
    2. Back up the following data directories.
      Directory Contents
      /opt/collabnet/teamforge/var User-created data, such as artifact attachments
      /opt/collabnet/reviewboard Review Board data
      /svnroot Subversion source code repositories
      /sf-svnroot Subversion repository for branding data
      /cvsroot CVS source code repositories (required only if you have CVS)
      /gitroot Git source code repositories
      cp -Rpf /svnroot /sf-svnroot /cvsroot /gitroot /opt/collabnet/teamforge/var /opt/collabnet/reviewboard /tmp/backup_dir
      
    3. Back up the /opt/collabnet/gerrit directory if you have Git integration.
      mkdir /tmp/backup_dir/gerrit
      cp -Rpfv /gitroot /tmp/backup_dir
      cp -Rpfv /opt/collabnet/gerrit/ /tmp/backup_dir/gerrit
      
    4. 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
      
    5. Compress your backed up data.
      cd /tmp
      tar czvf backup.tgz backup_dir
      

    On sites running TeamForge 16.10 or later versions:

    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 your 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 TeamForge data.

    If you are upgrading from TeamForge 16.7 or earlier versions:

    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.
      cd /opt/collabnet/teamforge/
      mkdir var
      cd var
      tar zvxf /tmp/backup_dir/pgsql.tgz
      cp -Rpfv /tmp/backup_dir/svnroot /svnroot
      cp -Rpfv /tmp/backup_dir/cvsroot /cvsroot
      cp -Rpfv /tmp/backup_dir/sf-svnroot /sf-svnroot
      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/gitroot /gitroot
      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
      
    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
      

    If you are upgrading from TeamForge 16.10 or later versions:

    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
      
    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 Review Board Database and Data Directories

The Review Board database 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 again.

In case you have Review Board on a separate server outside of the TeamForge Application Server, you must back up the /opt/collabnet/teamforge/var/pgsql directory from the Review Board Server that hosts the Review Board database service (reviewboard-database).

mkdir -p /tmp/backup_dir
cd /opt/collabnet/teamforge/var
tar -zcvf /tmp/backup_dir/reviewboard_pgsql.tgz pgsql/9.3

Copy the /tmp/reviewboard_pgsql.tgz file 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

Are You Upgrading from TeamForge 17.1 or Earlier to TeamForge 17.4 or Later?

If you are upgrading from TeamForge 17.1 or earlier to TeamForge 17.4 or later, regardless of whether you upgrade Review Board on the same or new hardware, you must back up your Review Board data directory from /opt/collabnet/reaviewboard/data and restore it to /opt/collabnet/teamforge/var/reviewboard/data.

  1. Back up the Review Board data directory.
    cd /opt/collabnet
    tar -zcvf /tmp/reviewboard_data.tgz reviewboard
    
  2. Copy the /tmp/reviewboard_data.tgz file to the /tmp directory of the new server if you are upgrading Review Board on a new hardware.
    scp /tmp/reviewboard_data.tgz username@newRBbox:/tmp
    

Are You Upgrading from TeamForge 17.4 to TeamForge 17.8 or Later?

  1. Back up the Review Board data directory.
    cd /opt/collabnet/teamforge/var
    tar -zcvf /tmp/reviewboard_data.tgz reviewboard
    
  2. Copy the /tmp/reviewboard_data.tgz file to the /tmp directory of the new server where you plan to have Review Board.

Restore Review Board Data

  1. Restore the Rveiew Board database (on the new server where you plan to have the Review Board database)

    cd /opt/collabnet/teamforge/var/
    tar -zxvf /tmp/reviewboard_pgsql.tgz
    
  2. Restore the Review Board data directories (on the new server where you plan to have Review Board).

    The default Review Board data directory has been changed from /opt/collabnet/reaviewboard/data to /opt/collabnet/teamforge/var/reviewboard/data in TeamForge 17.4. If you are upgrading from TeamForge 17.1 or earlier to TeamForge 17.4 or later, regardless of whether you upgrade Review Board on the same or new hardware, you must back up your Review Board data directory from /opt/collabnet/reaviewboard/data and restore it to /opt/collabnet/teamforge/var/reviewboard/data.

    If you are upgrading from TeamForge 17.4 (or later), the /opt/collabnet/teamforge/var directory would have been restored already as part of your TeamForge upgrade process, in which case you can skip restoring the /opt/collabnet/teamforge/var directory again.

    If you are upgrading on a new hardware, ensure that you have already copied the backup of the Review Board data directory to the /tmp directory of the new server.
    cd /opt/collabnet/teamforge/var/
    tar -zxvf /tmp/reviewboard_data.tgz
    

Create a TeamForge Database Dump

  1. Run the following commands to create a dump file of your site’s database. Do this on your database server in case you have your database running on a separate server.

       su - postgres
       /usr/bin/pg_dumpall > /opt/collabnet/teamforge/var/pgsql/9.3/backups/teamforge_data_backup.dmp
       exit
       mkdir /tmp/backup_dir
       cp /opt/collabnet/teamforge/var/pgsql/9.3/backups/teamforge_data_backup.dmp /tmp/backup_dir/
    
  2. If your reporting database is running on a separate port, back up your reporting database too.

    /usr/bin/pg_dumpall -p <reports_database_port> > /opt/collabnet/teamforge/var/pgsql/9.3/backups/teamforge_reporting_data_backup.dmp
    cp /opt/collabnet/teamforge/var/pgsql/9.3/backups/teamforge_reporting_data_backup.dmp /tmp/backup_dir/
    

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

Tags for this page: backup_restore upgrade postgres datamart