Restoring GitCentric

This section provides information about restoring GitCentric from a backup.

Prerequisites

In order to successfully run the full_restore.sh command:

  • You must have an existing GitCentric installation to use as the target for the restore operation. This GitCentric installation can be empty.
  • <ac_home>/jre/bin must be in your system’s search path (set using the $PATH environment variable)
  • <ac_home>/postgresql/bin must be in your system’s search path (set using the $PATH environment variable)

What Gets Restored?

The full_restore.sh command restores all the files and databases in the kando_backup_site_etc_<yyyymmdd>.tar created by the full_backup.sh command. See What gets backed up? for more information.

Caution: The full_restore.sh command completely overwrites an existing GitCentric installation. If you are restoring to an existing GitCentric installation, make sure there is no data under the GitCentric home directory that needs to be saved.

Back to top

How to Restore GitCentric

To restore GitCentric:
  1. Stop the GitCentric server using shutdown.sh:
    <ac_home>/WebUI/tomcat/bin/shutdown.sh
  2. Run full_restore.sh -l <path to gc_home> <backup.tar file>

    where

    • <path to gc_home> is the full path to the GitCentric home directory to which you want to restore.
    • <backup.tar file> is the name of the .TAR file created by full_backup.sh.

    For example:

    ./full_restore.sh -l /home/gitcentric/AccuRevGitCentric kando_backup_site_etc_<20150213>.tar
  3. Review the full_restore.sh output and perform any required actions. For details, see Restore scenarios.
  4. Restart the Tomcat web server:
    <ac_home>/WebUI/tomcat/bin/startup.sh

    Note: Make sure that the user starting Tomcat web server has write access to the logs, temp, webapps, and work directories in <ac_home>/WebUI/tomcat. This user should have read access to all other Tomcat web server directories and files.

Back to top

Additional steps for restoring

If your GitCentric restore was successful, you might need to perform one or more of the following tasks depending on whether or not you restored GitCentric to a new location or to a new machine. In addition, you might need to merge Gerrit configuration files.

If you restored to a new location on the same machine

If you restored GitCentric to a new location on the existing machine, you need to:

  1. Modify docBase in <ac_home>/WebUI/tomcat/conf/Catalina/<hostname>/gitcentric.xml and kandoBridge.xml to point to the new GitCentric location.
  2. Compare Gerrit configuration files in kando_backup_site_etc_<yyyymmdd>.tar and merge any changes required to support your GitCentric installation to the new ../site/etc.
  3. Restart Tomcat web server:
    <ac_home>/WebUI/tomcat/bin/shutdown.sh
    <ac_home>/WebUI/tomcat/bin/startup.sh

If you restored to a new machine

If you restored GitCentric to a new machine, you need to:

  1. Set up Tomcat web server on the new machine with:
    • <ac_home>/WebUI/tomcat/conf/Catalina/<hostname>/gitcentric.xml
    • <ac_home>/WebUI/tomcat/conf/Catalina/<hostname>/kandoBridge.xml
  2. Compare Gerrit configuration files in kando_backup_site_etc_<yyyymmdd>.tar and merge any changes required to support your GitCentric installation to the new ../site/etc.
  3. Restart Tomcat web server to adjust AccuRev settings:
    <ac_home>/WebUI/tomcat/bin/shutdown.sh
    <ac_home>/WebUI/tomcat/bin/startup.sh
  4. Use PostgreSQL psql or pgadmin tools to edit the Kando database acserver table to correct the server client path for each AccuRev Server.

If you restored to the same location

If your GitCentric restore was successful, you might need to perform one or more of the following tasks depending on whether or not you restored GitCentric to a new location or to a new machine. In addition, you might need to merge Gerrit configuration files.

If you restored to the same location, simply unpack the kando_backup_site_etc_<yyyymmdd>.tar file by running:

tar xvf kando_backup_site_etc_<yyyymmdd>.tar

Back to top

Restore scenarios

This section describes several restore scenarios: overflow, rollback, and missing branch in the repo copy.

In typical usage, GitCentric displays a message like the following for each Git branch that is successfully restored:

Processing branch refs/heads/master in repository /sandbox/llowry/tmp/ws/git/Repo2.git/
==============================
Branch is in sync with the GitCentric database.

When the restore is successful, no action is required on the part of the GitCentric administrator. The remainder of this section describes other scenarios that require the attention of the GitCentric administrator.

Back to top