[horde] Upgrading to 4 from Groupware 1.2.9

Simon Brereton simon.brereton at buongiorno.com
Tue Oct 4 15:07:33 UTC 2011


> -----Original Message-----
> From: Brian Spraker [mailto:spraker at yahoo.com]
> ________________________________
> 
> From: Simon Brereton <simon.brereton at buongiorno.com>
> > -----Original Message-----
> > From: horde-bounces at lists.horde.org [mailto:horde-
> > bounces at lists.horde.org] On Behalf Of Jan Schneider Zitat von Brian
> > Spraker <spraker at yahoo.com>:
> >
> > > Greetings all,
> > >
> > > I am looking to perform an upgrade of the Horde system from
> > Groupware
> > > 1.2.9 to the new system I've seen that appears to be stable and
> > > working.
> > >
> > > However, I'm a bit concerned about the database transition during
> > this time.
> > >
> > > Currently, I have these items installed and working without
> > problem:
> > >
> > > Horde Groupware Webmail Edition 1.2.9 Address Book (turba) H3
> > (2.3.5)
> > > Calendar (kronolith) H3 (2.3.5) Dynamic Mail (dimp) H3 (1.1.6)
> > Filters
> > > (ingo) H3 (1.2.5) Horde (horde) 3.3.11 Mail (imp) H3 (4.3.9)
> Notes
> > > (mnemo) H3 (2.2.4) Password (passwd) H3 (3.1.3) Tasks (nag) H3
> > (2.3.6)
> > > Vacation (vacation) H3 (3.2.1)
> > >
> > >
> > > I understand that pear can be used to install everything - and I
> > also
> > > see the files are available for download if I check for newer
> > versions
> > > (Groupware shows 4.0.3 upgrade exists and Horde shows 4.0.9
> upgrade
> > > exists - but all others look to be updated).
> > >
> > > When I go to the page to download the updates, I'm quite confused
> > as
> > > to what I need to download in order to perform the updates.  I
> > could
> > > use pear - but I'm concerned how that installer works - and where
> > the
> > > files will be placed (is there a way to overwrite the default
> > install
> > > directory?)
> > >
> > > Therefore, can anyone provide pointers on how I can upgrade to
> the
> > > newest applications and ensure that nothing in the database would
> > be
> > > lost during the process?
> >
> > http://www.horde.org/apps/webmail/docs/INSTALL
> 
> Not sure about Groupware, but I imagine it's the same.  There are
> good reasons not install over your current document root.  But the
> install instructions in general can't be easier.  Add the channel to
> Pear, prime the channel, install the packages you want..  It should
> take about 20 minutes and 4-6 commands depending on your system.
> 
> Simon
> 
> Appreciate the information.  The only thing I'm concerned about is
> any potential database manipulation that I currently have set.  I've
> added some custom fields to some tables and added some tables to the
> database.

I appreciate the concern - as someone who did the same.  Here's what I found.  YMMV.

	Back-up your current DB just in case things go wrong...

mysqldump -u root -p --databases  horde > horde.datestamp.sql

	Make a copy of your DB and call it horde4 (for example).

	Install v4

pear install pear/Date_Holidays
pear channel-discover pear.horde.org
pear install horde/horde_role
pear run-scripts horde/horde_role

	The last command will ask you for the file system location for your Horde installation. This should be some path in your web server's document root, e.g. /usr/share/horde4

	To install the beta release of Horde, run the following commands:

pear install horde/horde horde/webmail (or whatever the install documents said - I installed a bunch of stand-alone apps at this point).


	do a little bit of prep.

pear install Services_Weather Cache Auth_SASL Net_DNS2 Net_SMTP
cd /usr/share/downloads/
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip -dv GeoLiteCity.dat.gz
mv GeoLiteCity.dat /usr/share/horde4/
mkdir /var/log/horde
chmod 660 /var/log/horde/*
chown root:www-data /var/log/horde/*
chmod 774 /usr/share/horde4/static/


	Create a new DB and create the user/permissions.  CHANGE THE PASSWORD!

mysql -u root -p -e "create database horde DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; grant all privileges on horde4test.* to 'horde'@'localhost' identified by 'XXXXXXXXXX'; 

	go to the /usr/share/horde4/config/ directory of your Horde installation and copy conf.php.dist to conf.php:

cd /usr/share/horde4/config/
cp conf.php.dist conf.php
chown -R www-data /usr/share/horde4/

	Upgrade and Install Pear packages 
pear upgrade
pear install date mdb2#mysql mdb2#mysqli http log
pecl install fileinfo
pecl install idn
pecl install imagick
pecl install lzf
pecl install memcache
	
	vim /etc/php5/apache2/conf.d/lzf.ini
; configuration for php LZF module
extension=lzf.so

	Then point your browser to the installation location, go to the Administration/Configuration screen and start configuring. You probably want
to:

1. Configure a real authentication backend!
2. Configure a database backend (Horde configuration, Database tab)
3. Install the database tables ("Update all DB schemas" button)
4. Configure any other applications you installed
5. Create xxxxx.local.php for any local changes.


	Configure Horde
	When you get to the DB configuration select the new DB you created earlier (horde4test)
	Save the configuration 

	Configure Turba
	Configure Kronolith
	Configure Ingo
	Configure Mnemo
	Configure IMP

	Make a backends.local.php

cp /usr/share/horde4/imp/config/backends.php /usr/share/horde4/imp/config/backends.local.php
vim /usr/share/horde4/imp/config/backends.local.php

	The script to generate alarm notifications through a cron job (``scripts/alarms.php``) has been renamed and is installed to a different location when using the PEAR installation method. The new name is ``bin/horde-alarms`` and it will be installed to ``/usr/bin/horde-alarms`` by default. Update your cron jobs accordingly.

vim /etc/cron.daily/kronolith
/usr/bin/horde-alarms /usr/share/horde4/kronolith/scripts/reminders.php


AT THIS POINT YOU SHOULD TEST BECAUSE YOU'RE GOING TO BREAK IT NOW

	Now change the DB in the Horde DB Configuration tab.
	Change the Horde DB config to point to your new (but old DB - horde4 from my example)

mysql -u root -p
use horde4;
update kronolith_events set event_creator_id=lower(event_creator_id);
	(that last one is because I had an issue with calendars not showing up for some users - see below.  *Use with caution*)!!!

	Save the configuration and update the data-tree to SQL:

/usr/bin/horde-convert-datatree-groups-to-sql
/usr/bin/horde-convert-datatree-perms-to-sql
/usr/bin/horde-move-history-out-of-datatree
/usr/bin/ingo-convert-datatree-shares-to-sql
/usr/bin/kronolith-convert-datatree-shares-to-sql
/usr/bin/mnemo-convert-datatree-shares-to-sql
/usr/bin/nag-convert-datatree-shares-to-sql
/usr/bin/turba-convert-datatree-shares-to-sql

	Now run:

/usr/bin/horde-db-migrate

	When you reload the Admin panel all the database schemas should be up-to-date. 

	Add in any custom changes to match the ones in your DB and change any attributes (for example, I like to make lastname not required).

vim /usr/share/horde4/turba/config/attributes.local.php
//Added by SPB
$attributes['workEmail'] = array(
        'label' => _("Work Email"),
        'type' => 'email',
        'required' => false,
        'params' => array('allow_multi' => false, 'strip_domain' => false, 'link_compose' => true)
);

$attributes['workCellPhone'] = array(
    'label' => _("Work Mobile Phone"),
    'type' => 'cellphone',
    'required' => false
);

vim /usr/share/horde4/turba/config/backends.local.php
//Added by SPB
        'workEmail' => 'object_workemail',
        'homePhone' => 'object_homephone',
        'workPhone' => 'object_workphone',
        'cellPhone' => 'object_cellphone',
        'workCellPhone' => 'object_cellphone',     

//Added by SPB
                _("Communications") => array('email', 'workEmail', 'homePhone', 'workPhone',
		'cellPhone', 'workCellPhone', 'fax', 'pager''imaddress',
		'imaddress2', 'imaddress3'),


	Finally lock-down your configurations files:

chown -R root.www-data /usr/share/horde4/*
chmod 0440 /usr/share/horde4/config/*
chmod 0440 /usr/share/horde4/imp/config/*
chmod 0440 /usr/share/horde4/ingo/config/*
chmod 0440 /usr/share/horde4/kronolith/config/*
chmod 0440 /usr/share/horde4/mnemo/config/*
chmod 0440 /usr/share/horde4/nag/config/*
chmod 0440 /usr/share/horde4/turba/config/*


NB - I have NO experience with Groupware.  This is what I did for the standalone installation.  Some (all?) commands might be different for you.

All my data and old DB changes came across (although I had to make the changes  in *.local.php to match (they were previously in the old config files so it's largely copy and paste).  However, I'm not a php or expert.  This worked for me and I'm sure Jan and Michael's hair probably turned a bit white reading this.  I may have taken the long way around in some cases and I may yet experience problems that I've introduced.  But so far (3 months in production) I've not experienced anything fatal - some minor issues that were relatively simple to look up and fix (for example the creator_id for the calendar, etc).


Be brave.  Not installing over your old document root means you can set this up on a sub URL,  and satisfy yourself that it's working and then just redo the DB steps after you change the webserver document root to point to the new installation to go live.  Heed Jan's warning that your changes may collide with changes made to the H4 intfrastructue.  But you should be aware of this when testing.


Simon





More information about the horde mailing list