- 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.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
-
Log on to the TeamForge server that you want to back up.
- 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.
- Go to My Workspace > Admin.
- Click System Tools from the Projects menu.
- Click Customizations.
- 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.
-
Stop TeamForge.
Important: Stop TeamForge on all the servers in a distributed setup.- 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
- If you are upgarding from TeamForge 16.7 or earlier releases:
-
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
- If you are upgrading from TeamForge 16.3:
-
Back up your site data.
On sites running TeamForge 17.1 or earlier versions (with PostgreSQL 9.3/9.2):
-
Create a dump of your site’s database.
PostgreSQL 9.3:
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/
PostgreSQL 9.2:
su - postgres /usr/bin/pg_dumpall > /opt/collabnet/teamforge/var/pgsql/9.2/backups/teamforge_data_backup.dmp exit mkdir /tmp/backup_dir cp /opt/collabnet/teamforge/var/pgsql/9.2/backups/teamforge_data_backup.dmp /tmp/backup_dir/
On sites running TeamForge 16.7 or earlier versions:
- Back up your site database.
Tip: Do this on the server that hosts the TeamForge database and datamart services.
mkdir -p /tmp/backup_dir cd /var/lib tar -zcvf /tmp/backup_dir/pgsql.tgz pgsql/9.3
- Back up the following data directories.
Tip: In a distributed setup, you must backup specific directories such as
/svnroot
and/cvsroot
from the server that hosts those SCM services.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
- 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 /gitroot /tmp/backup_dir cp -Rpfv /opt/collabnet/gerrit/ /tmp/backup_dir/gerrit
- Back up the EventQ YAML files and directories if you have EventQ installed.
Tip: Do this on the server that hosts TeamForge EventQ services.
cp -Rpfv /opt/collabnet/eventq/config/*.yml /opt/collabnet/mongodb /opt/collabnet/rabbitmq /tmp/backup_dir
- Compress your backed up data.
cd /tmp tar czvf backup.tgz backup_dir
On sites running TeamForge 16.10 or later versions:
- 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
- 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
- Back up the EventQ YAML files and directories if you have EventQ installed.
Tip: Do this on the server that hosts TeamForge EventQ services.
cp -Rpfv /opt/collabnet/eventq/config/*.yml /opt/collabnet/mongodb /opt/collabnet/rabbitmq /tmp/backup_dir
- Compress your backup data.
cd /tmp tar czvf backup.tgz backup_dir
-
-
Back up your SSH keys, if any.
-
Back up your SSL certificates and keys, if any.
- 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
-
Restore TeamForge data.
If you are upgrading from TeamForge 16.7 or earlier versions:
- Log on to the server where you want to restore the data and unpack the
backup.tgz
file.cd /tmp tar xzvf backup.tgz
- 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/
- 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
- 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:
- Log on to the server where you want to restore the data and unpack the
backup.tgz
file.cd /tmp tar xzvf backup.tgz
- Restore the database and data directories.
cp -Rpfv /tmp/backup_dir/var /opt/collabnet/teamforge/
- 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
- 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
- Log on to the server where you want to restore the data and unpack the
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
/opt/collabnet/reviewboard/data
to /opt/collabnet/teamforge/var/reviewboard/data
in TeamForge 17.4.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/reviewboard/data
and restore it to /opt/collabnet/teamforge/var/reviewboard/data
.
- Back up the Review Board data directory.
cd /opt/collabnet tar -zcvf /tmp/reviewboard_data.tgz reviewboard
- 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?
- Back up the Review Board data directory.
cd /opt/collabnet/teamforge/var tar -zcvf /tmp/reviewboard_data.tgz reviewboard
Tip: If you are upgrading from TeamForge 17.4 (or later), the/opt/collabnet/teamforge/var
directory would have been backed up already as part of your TeamForge upgrade process, in which case you can skip backing up the/opt/collabnet/teamforge/var
directory again. - 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
-
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
-
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/reviewboard/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/reviewboard/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
-
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.
Note: These commands are for a PostgreSQL database, which is the default. If your site uses an Oracle database, follow the Oracle Backup Procedure instead.-
On sites running TeamForge 16.7 or earlier versions:
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/
-
On sites running TeamForge 16.10 or later versions:
su - postgres /usr/bin/pg_dumpall > /opt/collabnet/teamforge/var/pgsql/9.6/backups/teamforge_data_backup.dmp exit mkdir /tmp/backup_dir cp /opt/collabnet/teamforge/var/pgsql/9.6/backups/teamforge_data_backup.dmp /tmp/backup_dir/
-
Related Links
Back up and Restore TeamForge Data Using the teamforge.py Script
[]: