Upgrade to TeamForge 16.3 on new hardware - Black Duck Code Sight on a separate server

To upgrade to TeamForge 16.3, set up a new hardware, then bring your old site's data and convert it. As Black Duck Code Sight 2.1.3 has no support for RHEL/CentOS 7.x, you must install Black Duck Code Sight on a separate RHEL/CentOS 6.7 server and move your Black Duck Code Sight data to this server.

In this option, the following services run on the application server (we call this my.app.host). Black Duck Code Sight Server runs on a separate RHEL/CentOS 6.7 server (we call this my.codesight.host).

Log on to the server as root user always.

Do the following on the new TeamForge Application Server - my.app.host

  1. Install Red Hat Enterprise Linux/CentOS 7.2 and log in as root.
    Important: Don't customize your installation. Select only the default packages list.
  2. Create a file, /etc/security/limits.d/teamforge.conf, and make sure it has the following "nproc" and "nofile" settings.
    • vim /etc/security/limits.d/teamforge.conf
    • sf-admin soft nproc 10240
    • sf-admin hard nproc 10240
    • sf-admin hard nofile 65536
    • sf-admin soft nofile 65536
    • Save the file and reboot the server.
  3. Check your basic networking setup. See Set up networking for your TeamForge server for details.

Do the following on the existing TeamForge application server

  1. Stop TeamForge.
    • /etc/init.d/collabnet stop all
  2. Back up your site database.
    Tip: /tmp/backup_dir is just an example. You can use any directory or partition you prefer to store your backup files.
    • mkdir -p /tmp/backup_dir
    • cd /var/lib
    • tar -zcvf /tmp/backup_dir/pgsql.tgz pgsql/9.3
  3. Back up the file system data.
    Tip: /tmp/backup_dir is just an example. You can use any directory or partition you prefer to store your backup files.
    1. Make an archive file with 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 (not present on all sites)
      /gitroot GIT source code repositories
      • cp -Rpfv /svnroot /sf-svnroot /cvsroot /opt/collabnet/teamforge/var /opt/collabnet/reviewboard /tmp/backup_dir
      If GIT integration is enabled, do the following:
      • mkdir /tmp/backup_dir/gerrit
      • cp -Rpfv /gitroot /tmp/backup_dir
      • cp -Rpfv /opt/collabnet/gerrit/ /tmp/backup_dir/gerrit
      Compress your backup data.
      • cd /tmp
      • tar czvf 82backup.tgz backup_dir
    2. Back up your SSH keys, if any.
    3. Back up your SSL certificates and keys, if any.

  1. Copy the master configuration file from the old server to the /tmp directory on the new TeamForge and Black Duck Code Sight servers.
    • scp /opt/collabnet/teamforge-installer/8.2.0.0/conf/site-options.conf username@newbox:/tmp
    Tip: scp is just an example. You can choose any file transfer method you prefer.
  2. Copy the file system data to the new TeamForge and Black Duck Code Sight servers.
    • scp /tmp/82backup.tgz username@newbox:/tmp

Do the following on the new TeamForge Application Server - my.app.host

  1. Unpack the file system data.
    • cd /tmp
    • tar xzvf 82backup.tgz
  2. If the TeamForge server has SELinux enabled, run it in 'Permissive' mode temporarily while installing or upgrading TeamForge.
    1. Verify if SELinux is running in enforcing mode.
      • getenforce
    2. If the output of the getenforce command is "Permissive", continue with the next step. If not, run the following command to bring it to 'Permissive' mode.
      • setenforce 0
    See Set up SELinux to have TeamForge run in SELinux mode after completing the installation or upgrade.
  3. Upgrade the operating system packages.
    • yum upgrade
  4. Reboot the server.
    • reboot
  5. Configure your TeamForge installation repository.
    • TeamForge installation repository configuration for sites with internet access
    1. Contact the CollabNet Support and download the TeamForge 16.3 installation repository package to /tmp.
    2. Install the repository package.
      • yum install -y /tmp/collabnet-teamforge-repo-16.3-1.noarch.rpm
    3. Refresh your repository cache.
      • yum clean all
    • TeamForge installation repository configuration for sites without internet access
    1. Contact the CollabNet Support to get the auxiliary installer package for TeamForge 16.3 disconnected installation and save it in /tmp.
      • Red Hat Enterprise Linux/CentOS 7.2 64 bit RPM package: CTF-Disconnected-media-16.3.924-7294.rhel7.x86_64.rpm
        Note: In addition to the above CentOS 7.2 64 bit RPM package, you must get the following CentOS 7.2 compatibility RPM, which is required for TeamForge 16.3 disconnected media installation on CentOS 7.2 profile: compat-ctf-dc-media-1.0-1.el7.centos.noarch.rpm.
    2. Unpack the disconnected installation package.
      • rpm -Uvh <package-name>
    3. Unpack the compat-ctf-dc-media-1.0-1.el7.centos.noarch.rpm package if you are installing TeamForge 16.3 on CentOS 7.2.
      • rpm -ivh compat-ctf-dc-media-1.0-1.el7.centos.noarch.rpm
    4. Note: If the Red Hat Enterprise Linux/CentOS installation DVD is mounted already, skip the following instructions. If not, mount the DVD.
      Mount the Red Hat Enterprise Linux/CentOS installation DVD. The DVD contains the necessary software and utilities required for installing TeamForge without internet access.

      In the following commands, replace "cdrom" with the identifier for your server's CD/DVD drive, if necessary.

      • cd /media/
      • mkdir cdrom
      • mount /dev/cdrom ./cdrom/

      If there are any spaces in the automount, unmount it first and mount it as a filepath, with no spaces.

    5. Create a yum configuration file that points to the Red Hat Enterprise Linux/CentOS installation DVD.
      • vi /etc/yum.repos.d/cdrom.repo
      Here's a sample yum configuration file.
      [RHEL-CDROM] 
      name=RHEL CDRom 			
      baseurl=file:///media/cdrom/Server/
      gpgfile=file:///media/cdrom/RPM-GPG-KEY-redhat-release 
      enabled=1
      gpgcheck=0
    6. Verify your yum configuration files.
      • yum list httpd
      • yum list apr
  6. Install the following application packages.
    1. TeamForge: To install the TeamForge application packages run the following command:
      • yum install teamforge
    2. GIT: To install the GIT packages run the following command:
      • yum install teamforge-git
  7. Reload the PostgreSQL data.
    • cd /var/lib
    • mv pgsql pgsql_orig
    • tar -zxvf /tmp/backup_dir/pgsql.tgz
  8. Set up your site's master configuration file.
    Always use the site-options-dedicated.conf file that's packaged with the TeamForge version you are upgrading to. Refer to the TeamForge 8.2 site-options.conf file, understand your site settings and set up your TeamForge 16.3 site-options.conf file.
    CAUTION:
    You run the risk of missing out on newly added site option tokens if you keep reusing your site-options.conf file from an older TeamForge version on newer versions. See Site options change log for more information.
    1. Copy the /opt/collabnet/teamforge-installer/16.3/conf/site-options-dedicated.conf file to the TeamForge installer directory.
      • cd /opt/collabnet/teamforge-installer/16.3/
      • cp conf/site-options-dedicated.conf conf/site-options.conf
    2. Set up your site options: In addition to the new site options you may set up for TeamForge 16.3, refer to the TeamForge 8.2's site-options.conf file in the /tmp directory and make sure that the TeamForge 16.3 site-options.conf file inherits all the required site options.
      • sudo vi /opt/collabnet/teamforge-installer/16.3/conf/site-options.conf
    3. Update the host name and domain name, if required.
      HOST_localhost=app database datamart etl indexer subversion cvs
      DOMAIN_localhost=my.app.domain.com
      Add 'gerrit' to the HOST_localhost token if you are installing Git.
      HOST_localhost=app database datamart etl indexer subversion cvs gerrit
      Add 'binary' to the HOST_localhost token if you are installing Nexus.
      HOST_localhost=app database datamart etl indexer subversion cvs gerrit binary
      Configure the following token if you are installing Black Duck Code Sight.
      HOST_my.codesight.domain.com=codesearch
    4. Turn on the SSL for your site by editing the relevant variables in the site-options.conf file. To generate the SSL certificates, see Generate SSL certificates.
      SSL=on
      SSL_CERT_FILE
      SSL_KEY_FILE
      SSL_CHAIN_FILE
      Note: The SSL_CERT_FILE and SSL_KEY_FILE tokens need an absolute path. The SSL_CHAIN_FILE token is optional.
    5. If the token REQUIRE_PASSWORD_SECURITY is enabled, then set a value for the token, PASSWORD_CONTROL_EFFECTIVE_DATE.
      CAUTION:
      The Password Control Kit (PCK) disables, deletes or expires user accounts that don't meet the password security requirements starting from the date set for the PASSWORD_CONTROL_EFFECTIVE_DATE token. If a date is not set, the PCK disables, deletes or expires user accounts immediately. See PASSWORD_CONTROL_EFFECTIVE_DATE for more information.
    6. TeamForge 7.1 and later support automatic password creation. See AUTO_DATA for more information.
    7. Password obfuscation: The password obfuscation is enabled by default. As a result, all password-related tokens are encrypted in all the TeamForge configuration files.
      Restriction: The password-related tokens cannot contain the following characters in the site-options.conf file: $<>/\'"`
      • To disable password obfuscation, set OBFUSCATION_ENABLED=false.
      • To configure the obfuscation key, set OBFUSCATION_KEY=<Any AlphaNumeric value with length >= 8 bytes>. The default value of OBFUSCATION_KEY token is XSJt43wN.
    8. Ensure to set the token DEDICATED_INSTALL=true.
    9. Include the list of non-expiring TeamForge user accounts (password never expires).
      USERS_WITH_NO_EXPIRY_PASSWORD=admin,nobody,system,scmviewer,scmadmin
    10. Make sure that the following tokens have a value if ETL is enabled.
      SOAP_ANONYMOUS_SHARED_SECRET
      ETL_SOAP_SHARED_SECRET
    11. Configure the Black Duck Code Sight tokens. See Black Duck Code Sight site-option tokens.
    12. To enable the history protection feature of TeamForge Git integration, set the GERRIT_FORCE_HISTORY_PROTECTION=true. For more information, see GERRIT_FORCE_HISTORY_PROTECTION.
    13. If you have LDAP set up for external authentication, you must set the “REQUIRE_USER_PASSWORD_CHANGE” site options token to false.
    14. Ensure to set the token SELINUX_SETUP=true.
    15. Make sure the PostgreSQL tokens in the site-options.conf file are set as recommended in the following topic: What are the right PostgreSQL settings for my site?
    16. If the first interface of "ifconfig -a" is not eth0/enp0*, set the POSTGRES_INTERFACE token in the site-options.conf file with the NIC name that PostgreSQL should listen to, without which you cannot successfully create runtime.
    17. Configure the JBOSS_JAVA_OPTS site-options.conf token. See JBOSS_JAVA_OPTS.
      Important: All JVM parameters but -Xms1024m and -Xmx2048m have been hard-coded in the TeamForge core application. You need not manually configure any other parameter (such as -XX:MaxMetaspaceSize=512m -XX:ReservedCodeCacheSize=128M -server -XX:+HeapDumpOnOutOfMemoryError -Djsse.enableSNIExtension=false -Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000) in the site-options.conf file.

      When you change the default value of a JVM parameter such as "-XX:HeapDumpPath", the JBoss runtime parameters include both the user defined and default values for the JVM parameter. However, JBoss runs with the user defined value and ignores the default value.

    18. Save the site-options.conf file.
  9. Recreate the runtime environment.
    • cd /opt/collabnet/teamforge-installer/16.3
    • ./install.sh -r -I -V

Do the following on the Black Duck Code Sight server - my.codesight.host.

  1. Set up Black Duck Code Sight on RHEL/CentOS 6.7. See Install Black Duck Code Sight on a separate RHEL/CentOS 6.7 server.

Do the following on the new TeamForge Application Server - my.app.host

  1. Reload the svnroot, sf-svnroot, cvsroot, gitroot and var directories.
    • mv svnroot/ svnroot_orig
    • mv cvsroot/ cvsroot_orig
    • If you have Git integration: mv gitroot/ gitroot_orig
    • 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/var
    If Git integration is enabled, do the following:
    • 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
  2. Recreate the runtime environment to set the database credentials.
    • cd /opt/collabnet/teamforge-installer/16.3
    • ./install.sh -r -I -V
  3. Update the file permissions on your site's data.
    • /opt/collabnet/teamforge/runtime/scripts/fix_data_permissions.sh
    Note: This process can take a long time for sites with a lot of data.
  4. Convert your site data to work with TeamForge 16.3.
    Tip: Before you kick off the data migration, do the following:
    • Use the /etc/init.d/collabnet status command to make sure the JBoss, Tomcat and Tomcatcs services are stopped.
    • If any of the trackers in your project already contains a field with the name team, conflict may arise while running the migrate.py script. This is because of the inclusion of the Team feature in TeamForge 8.0. To prevent this conflict, follow the steps given in FAQ on troubleshooting.
    • /opt/collabnet/teamforge/runtime/scripts/migrate.py
    The migrate.py script locates the existing site data and modifies it as needed.

    This includes configuration data for LDAP and the James mail server. Any modifications that you have applied to these components on your old site are reproduced on your upgraded TeamForge 16.3 site.

  5. Start TeamForge.
    • /etc/init.d/collabnet start

Note: Gerrit is configured as part of the post installation tasks included in the post-install.py script. As a result, Gerrit's status would be Not configured during startup, which you can safely ignore.

  1. If you have CVS integrations, synchronize permissions post upgrade. See, Synchronize TeamForge source control integrations.
  2. Run the TeamForge post installation script. For more information, see post-install.py.
    • /opt/collabnet/teamforge/runtime/scripts/post-install.py
    Note: In case you face any GIT-related issues while running the post-install.py script, see Post install fails for GIT. What should I do?.
  3. Run the following query to get the repository IDs of the repositories for which the Available in Search Results option was enabled.
    • echo "select sr.id from folder f, project p,scm_repository sr where f.id like 'reps%'and p.is_deleted='f' and p.id=f. project_id and sr.search_enabled='t'and sr.id=f.id and f.is_deleted='f';" | /opt/collabnet/teamforge/runtime/scripts/psql-wrapper -t -A >>/tmp/repository-ids.txt
  4. As this is a new hardware upgrade, run the codesightmigration.sh script to have the code search project repository URLs point to the new server.
    Note: Make sure TeamForge and Black Duck Code Sight licenses are installed before running the codesightmigration.sh script.
    • /opt/collabnet/teamforge/runtime/scripts/codesearch/codesightmigration.sh --filename=/tmp/repository-ids.txt

Do the following on the Black Duck Code Sight server - my.codesight.host.

  1. Run the svn_cache.sh script.
    • cd /opt/collabnet/teamforge/runtime/scripts/codesearch/
    • ./svn_cache.sh <Repository Base URL Path of the SCM Integration Server>

    Provide a repository base URL path of the SCM integration server, for example, "http://myint.box.net/svn/repos", where myint.box is the server with the SCM integration server.

    In addition, if you add a new integration server at some point later, you must run this svn_cache.sh script, (after creating the new integration server), on the TeamForge application server.

Do the following on the new TeamForge Application Server - my.app.host

  1. Apply the finishing touches and make sure everything is running smoothly after upgrading to TeamForge 16.3.
    Important: Do not delete the teamforge-installer/16.3 directory. You will need it for future maintenance and upgrades.
    1. Log into your site as the administrator.
    2. If your site has custom branding, verify that your branding changes still work as intended. See Customize anything on your site.
    3. Let your site's users know they've been upgraded. See Communicate with all site users at once.
  2. Remove the backup files, if any, after the TeamForge site is up and running as expected. Remove the repository and the file system backup from the /tmp/backup_dir directory.
Note: After upgrade, it takes some time for the publishing repositories to get created for projects imported from other TeamForge sites.