Upgrade instructions for the Swarm Open Beta release
This section covers the steps to upgrade from Swarm's Open Beta release to the 2013.1 release. If you are not already running Swarm, these instructions do not apply to you. See the Swarm installation instructions.
Note
The instructions below can be applied to an OVA. The OVA's
SWARM_ROOT
, the folder where Swarm is installed, is
/opt/swarm
.
However, we recommend downloading the new OVA and then following the OVA setup steps. This provides you with an upgraded Swarm plus an updated web hosting environment within the OVA, which can include distribution, web server, PHP, and security updates.
If you have customized the original OVA's Swarm configuration, copy
/opt/swarm/data/config.php
to the same path in the
new OVA.
Copy all token files in /opt/swarm/data/queue/tokens/
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.
Warning!
P4PHP should be upgraded to the version included in the new Swarm release. If you have already configured PHP to use the Swarm-provided P4PHP (as recommended), this happens automatically. If you have manually installed P4PHP in some other fashion, upgrade P4PHP before you perform any of the upgrade steps below.
The following steps describe how to upgrade Swarm using the provided archive
file. SWARM_ROOT
refers to the current Swarm
installation.
-
Expand the new
swarm.tgz
:$ tar -zxf swarm.tgz
The contents of
swarm.tgz
are expanded into a top-level folder namedswarm-
, whereversion
version
corresponds to the version downloaded. This directory is identified asSWARM_NEW
below. -
Move
SWARM_NEW
to be a peer ofSWARM_ROOT
:$ mv SWARM_NEW SWARM_ROOT/../
-
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/
-
Create the queue token directory:
$ mkdir SWARM_NEW/data/queue
-
Copy the existing trigger token(s):
$ sudo cp -pR SWARM_ROOT/data/queue/tokens SWARM_NEW/data/queue/
-
Assign correct ownership to the new Swarm's data directory:
$ sudo chown -R
www
SWARM_NEW/dataNote
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 typicallyapache
for Red Hat/Fedora/CentOS,www-data
for Debian/Ubuntu,wwwrun
for SuSE,_www
for Mac OSX. -
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 isSWARM_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
. -
Modify
swarm-trigger-new.sh
to set theSWARM_HOST
variable appropriately. -
Modify
swarm-trigger-new.sh
to set theSWARM_TOKEN
variable appropriately. Use the same trigger token fromswarm-trigger.sh
. -
For Linux systems, ensure the script is executable:
$ sudo chmod +x swarm-trigger-new.sh
-
Replace the old trigger script with the new trigger script:
$ mv swarm-trigger-new.sh swarm-trigger.sh
-
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 output from running:
$ ./swarm-trigger.sh -o
-
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
-
Log in to Swarm.
-
To upgrade existing review records, visit the URL:
http://
myswarm
/upgradeReplace
myswarm
with your Swarm hostname.
All done!