Upgrade Z-Push (with Zimbra Backend)

From vWiki
Jump to navigation Jump to search

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...

  1. Create a copy of the Z-Push website
    1. Create a copy of the files
      • EG cp /var/www/z-push /var/www/z-push-test
    2. Clear-out any old data
      • EG echo > /var/www/z-push-test/debug.txt
      • EG rm -fr /var/www/z-push-test/state/*
    3. 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
  2. Create a test account on your Zimbra server through the web admin interface
  3. Copy an account you have access to into the new test account
    1. Log in to your zimbra server via SSH, and su to the zimbra user
    2. Export an account to a file...
      • EG zmmailbox -z -m user@domain.com getRestURL "//?fmt=tgz" > /tmp/test-user.tgz
    3. Import the file into the test account
      • EG zmmailbox -z -m test@domain.com postRestURL "//?fmt=tgz" /tmp/test-user.tgz

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
  1. Disable Z-Push
    • If Z-Push is the only website running on your server, just stop web service
      • EG apache2ctl stop
    • 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
  2. Move the existing site to a backup folder
    • EG mv /var/www/z-push /var/www/z-push-backup
  3. Recreate the directory for the site
    • EG mkdir /var/www/z-push
  4. Download the new Z-Push installation
  5. Download the new Zimbra Active-Sync 12.1 backend branch into a /zimbra folder
  6. Move unrequired files out of backend, leaving only backend.php and diffbackend.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/
  7. Move the zimbra.php file into backend
    • EG mv /var/www/z-push/zimbra/zimbra.php /var/www/z-push/backend/
  8. Restore the config
    • EG cp /var/www/z-push-backup/config.php /var/www/z-push/
  9. Restore the contents of the state folder
    • EG cp -r /var/www/z-push-backup/state/* /var/www/z-push/state/
  10. 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
  11. 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
  12. Re-enable Z-Push
    • If Z-Push is the only website running on your server, restart the web service
      • EG apache2ctl start
    • 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

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)