Upgrade Z-Push (with Zimbra Backend)
Upgrade Available?
To check that an upgrade is available, you need to compare the versions of what you have running against what's available in the SVN repository.
Run svn info
against your installation path, and against the repo. When running against your installation path you'll be provided with repo URL. For example...
root@web2:/var/www# svn info z-push/ Path: z-push URL: svn://svn.berlios.de/z-push/branches/as12.1 Repository Root: svn://svn.berlios.de/z-push Repository UUID: b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5 Revision: 1120 Node Kind: directory Schedule: normal Last Changed Author: dw2412 Last Changed Rev: 1120 Last Changed Date: 2012-02-07 06:21:29 +0000 (Tue, 07 Feb 2012) root@web2:/var/www# svn info svn://svn.berlios.de/z-push/branches/as12.1 Path: as12.1 URL: svn://svn.berlios.de/z-push/branches/as12.1 Repository Root: svn://svn.berlios.de/z-push Repository UUID: b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5 Revision: 1238 Node Kind: directory Last Changed Author: dw2412 Last Changed Rev: 1172 Last Changed Date: 2012-03-05 18:19:03 +0000 (Mon, 05 Mar 2012)
Note that you'll need to have installed using SVN in the first place for there to be version tracking in place.
Procedures
Create Testing Environment
Whether or not you have a large number of users to support it is always a good idea to test the upgrade procedure if at all possible. If you're running from on an Apache webserver this is most easily achieved by creating a copy of your existing Z-Push installation, and then using either a test account on your live Zimbra server, or if you have one, your backup or test server. As a broad overview...
- Create a copy of the Z-Push website
- Create a copy of the files
- EG
cp /var/www/z-push /var/www/z-push-test
- EG
- Clear-out any old data
- EG
echo > /var/www/z-push-test/debug.txt
- EG
rm -fr /var/www/z-push-test/state/*
- EG
- Create a copy of the site config
- EG
cp /etc/apache2/sites-available/z-push /etc/apache2/sites-available/z-push-test
- EG
cd /etc/apache2/sites-enabled
- EG
vi z-push-test
and update site hostname and path (you'll need to update DNS as well) - EG
apache2ctl -k graceful
- EG
- Create a copy of the files
- Create a test account on your Zimbra server through the web admin interface
- Copy an account you have access to into the new test account
- Log in to your zimbra server via SSH, and su to the zimbra user
- Export an account to a file...
- EG
zmmailbox -z -m user@domain.com getRestURL "//?fmt=tgz" > /tmp/test-user.tgz
- EG
- Import the file into the test account
- EG
zmmailbox -z -m test@domain.com postRestURL "//?fmt=tgz" /tmp/test-user.tgz
- EG
Upgrade
This upgrade procedure assumes the following.
- Path to Z-Push installation:
/var/www/z-push
- Path to Z-Push website config:
etc/apache2/sites-available/z-push
- Which is enabled by a file link from
etc/apache2/sites-enabled/z-push
- Which is enabled by a file link from
- Disable Z-Push
- If Z-Push is the only website running on your server, just stop web service
- EG
apache2ctl stop
- EG
- If Z-Push is on a shared server, disable the site and gracefully restart the web service
- EG
rm /etc/apache2/sites-enabled/z-push
- EG
apache2ctl graceful
- EG
- If Z-Push is the only website running on your server, just stop web service
- Move the existing site to a backup folder
- EG
mv /var/www/z-push /var/www/z-push-backup
- EG
- Recreate the directory for the site
- EG
mkdir /var/www/z-push
- EG
- Download the new Z-Push installation
- EG
svn checkout svn://svn.berlios.de/z-push/branches/as12.1 /var/www/z-push
- EG
- Download the new Zimbra Active-Sync 12.1 backend branch into a
/zimbra
folder- EG
mkdir /var/www/z-push/zimbra
- EG
svn checkout https://zimbrabackend.svn.sourceforge.net/svnroot/zimbrabackend/zimbra-backend/branches/as12.1 /var/www/z-push/zimbra
- EG
- Move unrequired files out of
backend
, leaving onlybackend.php
anddiffbackend.php
- EG
mkdir /var/www/z-push/backend-old
- EG
mv /var/www/z-push/backend/* /var/www/z-push/backend-old
- EG
mv /var/www/z-push/backend-old/backend.php /var/www/z-push/backend/
- EG
mv /var/www/z-push/backend-old/diffbackend.php /var/www/z-push/backend/
- EG
- Move the
zimbra.php
file intobackend
- EG
mv /var/www/z-push/zimbra/zimbra.php /var/www/z-push/backend/
- EG
- Restore the config
- EG
cp /var/www/z-push-backup/config.php /var/www/z-push/
- EG
- Restore the contents of the state folder
- EG
cp -r /var/www/z-push-backup/state/* /var/www/z-push/state/
- EG
- Allow write access to the
state
folder- EG
chgrp -R www-data /var/www/z-push/state
- EG
chown -R www-data /var/www/z-push/state
- EG
chmod -R g+w /var/www/z-push/state
- EG
- Create file for debug to go to
- EG
touch /var/www/z-push/debug.txt
- EG
chgrp www-data /var/www/z-push/debug.txt
- EG
chmod g+w /var/www/z-push/debug.txt
- EG
- Re-enable Z-Push
- If Z-Push is the only website running on your server, restart the web service
- EG
apache2ctl start
- EG
- If Z-Push is on a shared server, re-enable the site and gracefully restart the web service
- EG
cd /etc/apache2/sites-enabled/
- EG
ln -s ../sites-available/z-push z-push
- EG
apache2ctl graceful
- EG
- If Z-Push is the only website running on your server, restart the web service
Post Upgrade Testing
- Confirm you can send and receive email through an account on a mobile device
- Confirm you can create and delete a task, calendat item and contact on a mobile device and on the server (changes should be
visible on counterpart)