Swarm 2014.1: User Guide

Upgrade instructions for Swarm Beta Preview participants

This section covers the steps to upgrade from Swarm's Beta Preview release to the Open Beta release. If you are not already running Swarm, these instructions do not apply to you. If you are upgrading to Swarm's 2013.1 release, follow the steps on this page, and then perform the Open Beta upgrade.

Note

If you are running the Swarm OVA, we recommend downloading the new OVA, and then following the OVA setup steps. If you have customized the original OVA's Swarm configuration, copy /opt/swarm/data/config.php to the same path in the new OVA.

The following process attempts to minimize downtime, but a short period of downtime for Swarm users is unavoidable. There should be no downtime for your Perforce service. After a successful upgrade, all Swarm users are logged out.

If you are using Swarm in a production environment, we encourage you to test this upgrade process in a non-production environment first.

The following steps describe how to upgrade Swarm using the provided archive file. SWARM_ROOT refers to the current Swarm installation.

Note

The following instructions require the utility uuidgen.

  1. Expand the new swarm.tgz:

    $ tar -zxf swarm.tgz
    

    The contents of swarm.tgz are expanded into a top-level folder named swarm-version, where version corresponds to the version downloaded. This directory is identified as SWARM_NEW below.

  2. Move SWARM_NEW to be a peer of SWARM_ROOT:

    $ mv SWARM_NEW SWARM_ROOT/../
    
  3. Copy just the .htaccess file from the new Swarm to the old Swarm:

    $ cp -p SWARM_NEW/public/.htaccess SWARM_ROOT/public/.htaccess
    
  4. Copy just the data/config.php file from the old Swarm to the new Swarm:

    $ cp -p SWARM_ROOT/data/config.php SWARM_NEW/data/
    
  5. Create the trigger token directory:

    $ mkdir -p SWARM_NEW/data/queue/tokens
    
  6. Create a UUID trigger token:

    $ touch SWARM_NEW/data/queue/tokens/`uuidgen | tr '[:lower:]' '[:upper:]'`
    
  7. Assign correct ownership to the new Swarm's data directory:

    $ sudo chown -R www SWARM_NEW/data
    

    Note

    The www user above is an example of what the web server user name might be, and can vary based on distribution or customization. For example, the user is typically apache for Red Hat/Fedora/CentOS, www-data for Debian/Ubuntu, wwwrun for SuSE, _www for Mac OSX.

  8. Copy the new Swarm's updated trigger script to your Perforce server machine. For Linux systems, the script is SWARM_NEW/p4-bin/scripts/swarm-trigger.sh. For Windows systems, the script is SWARM_NEW/p4-bin/scripts/swarm-trigger.vbs.

    Warning!

    Do not overwrite the existing trigger script. Give the new script a new name, for example, swarm-trigger-new.sh.

  9. Modify swarm-trigger-new.sh to set the SWARM_HOST variable appropriately.

  10. Modify swarm-trigger-new.sh to set the SWARM_TOKEN variable appropriately. Use the name of the trigger token file created above.

  11. For Linux systems, ensure the script is executable:

    $ sudo chmod +x swarm-trigger-new.sh
    
  12. Replace the old trigger script with the new trigger script:

    $ mv swarm-trigger-new.sh swarm-trigger.sh
    
  13. As a Perforce user with super-level privileges, update the Perforce trigger table by running the p4 triggers command and replacing any swarm.* lines with the following:

    swarm.job      form-commit   job    "%quote%/path/to/swarm-trigger.sh%quote% -t job      -v %formname%"
    swarm.user     form-commit   user   "%quote%/path/to/swarm-trigger.sh%quote% -t user     -v %formname%"
    swarm.userdel  form-delete   user   "%quote%/path/to/swarm-trigger.sh%quote% -t userdel  -v %formname%"
    swarm.group    form-commit   group  "%quote%/path/to/swarm-trigger.sh%quote% -t group    -v %formname%"
    swarm.groupdel form-delete   group  "%quote%/path/to/swarm-trigger.sh%quote% -t groupdel -v %formname%"
    swarm.change   form-commit   change "%quote%/path/to/swarm-trigger.sh%quote% -t change   -v %formname%"
    swarm.shelve   shelve-commit //...  "%quote%/path/to/swarm-trigger.sh%quote% -t shelve   -v %change%"
    swarm.commit   change-commit //...  "%quote%/path/to/swarm-trigger.sh%quote% -t commit   -v %change%"
    

    Note

    Update the trigger script paths in each line above to reflect the actual script path on your Perforce server.

    For a Perforce service on Windows, ensure that swarm-trigger.sh is replaced with swarm-trigger.vbs.

    Warning!

    The use of %quote% is not supported on 2010.2 servers (it is harmless though); if you are using this version, ensure that you do not have any spaces in the pathname to this script.

  14. Replace the old Swarm with the new Swarm. Downtime occurs in this step.

    sudo apache2ctl stop; mv SWARM_ROOT to SWARM.old; mv SWARM_NEW SWARM_ROOT; sudo apache2ctl start
    

All done!

0 matching pages