4.0.x to 4.1.y
This section describes how to upgrade your existing eZ Publish 4.0.x installation to version 4.1.y. If you are upgrading from version 4.0.3 or earlier, you need to first upgrade to 4.0.3 before you can upgrade to 4.1. (Refer to either "Upgrading from 3.10.x to 4.0.y" or "Upgrading from 4.0.x to 4.0.y" depending on which version you are currently running.)
The upgrade procedure described below is generic and does not cover any specific cases (for example, running eZ Publish in a clustered environment).
Make sure that you have a working backup of the site before you do the actual upgrade.
Important upgrade notes:
- updateimagesystem.php needs to be run before the dbupdate scripts, otherwise the tables being upgraded will be removed.
The procedure for upgrading directly from version 4.0.x to 4.1.y consists of the following steps:
- Upgrading the distribution files to 4.1.y
- Upgrading custom extensions
- Updating image system
- Upgrading the database to 4.1.y
- Regenerate the autoload array for extensions
- Running the system upgrade scripts for versions from 4.0.x to 4.1.y
- Clearing the caches
Check the eZ Components 2008.2 requirements
With eZ Publish 4.1.0, eZ Components 2008.2 is the minimum version required. If you installed a previous version with PEAR, please upgrade to version 2008.2. For more information see also http://ezcomponents.org/docs/install
Step 1: Upgrading the distribution files
The easiest way to upgrade the distribution files is to unpack eZ Publish 4.1.0 to a separate directory and then copy the directories that contain site-specific files from the existing installation. Make sure that you copy the following directories:
- design/example
- design/example_admin
- var
- settings/siteaccess
- settings/override
Replace "example" and "example_admin" with the actual names of your siteaccesses.
Step 2: Custom extensions
If you are using custom extensions, the subdirectories inside the "extension" directory will also have to be copied. However, make sure that you do not overwrite any extensions that come with eZ Publish (currently "ezoe", "ezodf"). Note that upgrading the distribution files will overwrite the autoload arrays for extensions. You will need to re-generate the autoload arrays for active extensions late.
See below for dedicated upgrade instructions for ez flow and ez webin.
Note that ezdhtml is now replaced by ezoe, so you should not copy it over.
For eZ OE 5.0, you will need to have the following rewrite rule if using Virtual Hosts:
RewriteRule ^/var/[^/]+/cache/public/.* - [L]
For extension development: when using modules always make sure that $Result['path'] is assigned an array even if it's an empty one:
$Result['path'] = array();
For more detailed instructions, see the dedicated doc page: http://ez.no/doc/extensions/online_editor/5_x/installation
Step 3: updateimagesystem.php
This script is necessary to run if you have data of the 'ezimage' datatype, dating from before eZ Publish 3.3, in version 3.3 a new image system took over based on ezimagealiashandler.
If you are upgrading to the 4.1.x series of eZ Publish for the first time, and the installation at hand have been running since eZ Publish < 3.3 then you need to run the updateimagesystem.php script before running any of the dbupdate scripts for version 4.1.0 or 4.1.1.
If the installation at hand is a new installation or based on any eZ Publish version >= 3.3 then you can skip running the updateimagesystem.php script.
Step 4: Upgrading the database
The update script for the database is located in
<eZP root>/update/database/<mysql|postgresql>/4.1/dbupdate-4.0.0-to-4.1.0.sql
You can run this with the appropriate command line tool or application
Step 5: Regenerate the autoload array for extensions
The autoload system has also some changes, for example the autoload array for extensions is now placed in var/autoload of your eZ Publish installation (along teh class changes in extensions itself).
To regenerate the autoload array, execute the following script from
php bin/php/ezpgenerateautoloads.php --extension
Step 6: Running the system upgrade scripts
The update scripts are located in <root of ez publish installation>/update/common/scripts/4.1
- addlockstategroup.php: is used for creating locked states, part of the object states functionality. It might be useful to know that you can only execute this script once. If you wish to run it a second time, it must be done like this:
truncate ezcobj_state ; truncate ezcobj_state_group ; truncate ezcobj_state_group_language ; truncate ezcobj_state_language ; truncate ezcobj_state_link ; php update/common/scripts/4.1/addlockstategroup.php -sezwebin_site_admin
- fixclassremoteid.php: is used to fix remote ids of classes.
- fixezurlobjectlinks.php: is used to fix older occurrences of link items not being present in the ezurl_object_table for all versions/translations.
- fixobjectremoteid.php: is used to fix non-unique usage of content object remote ID's.
- initurlaliasmlid.php: initialize the ezurlalias_ml_incr table, part of the fixed issue #14077: eZURLAliasML database table lock and unlock code causes implicit commit of database transaction.
- correctxmlalign.php: after upgrading to 4.1 the default alignment for embedded images in ezxmltext datatype is removed, this script will allow you to have the correct xmlalignment.
Step 7: Clearing the caches
Whenever an eZ Publish solution is upgraded, all caches must be cleared in a proper way. This should be done from within a system shell:
- Navigate into the eZ Publish 4.1 directory.
- Run the script using the following shell command:
php bin/php/ezcache.php --clear-all --purge
Purging ensures that the caches are physically removed. When the "--purge" parameter is not specified, the caches will be expired but not removed.
Sometimes the script is unable to clear all cache files because of restrictive file/directory permission settings. Make sure that all cache files have been cleared by inspecting the contents of the various cache subdirectories within the "var" directory (typically the "var/cache/" and "var/<name_of_siteaccess>/cache/" directories). If there are any cache files left, you need to remove them manually.
Upgrading eZ Flow and/or Website Interface separately
Step 1: Backup
Before you will start the Website Interface or eZ Flow upgrading process make sure that you have backup of existing website state including database, extensions, INI settings, etc. During upgrade process existing ezflow and ezwebin extensions will be removed and replaced with new version. Website Interface and eZ Flow default content classes will be replaced as well. Upgrade script will also change some of the existing INI settings and add new ones which are required by latest version.
Step 2: eZ Flow upgrade
eZ Publish 4.1 comes with eZ Flow upgrade script which allows upgrade from previous version to the latest 1.1-0 version. To run upgrade process in automatic mode simply execute following command from eZ Publish root folder.
php bin/php/ezflowupgrade.php --to-version=1.1-0 --url=http://packages.ez.no/ezpublish/4.1/4.1.0
It is very important that user which will execute the upgrade script had correct permissions to modify content user extension, settings and var folders.
In order to get more information about available upgrade options, execute ezflowupgrade.php script with –help param.
php bin/php/ezflowupgrade.php --help
Step 3: Re-write rules
Users running their eZ Flow sites in VH mode should update their extension related re-write rules to the following:
Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|flash|images|lib|javascripts?)/.* - [L]
Step 4: Website Interface upgrade
Upgrading Website Interface is very similar to eZ Flow upgrade process. In order to upgrade existing installation to latest 1.4-0 version simply execute following command from eZ Publish root folder:
php bin/php/ezwebinupgrade.php --to-version=1.4-0 --url=http://packages.ez.no/ezpublish/4.1/4.1.0
Again, it is very important that user which will execute the upgrade script had correct permissions to modify content user extension, settings and var folders.
In order to get more information about available upgrade options, execute ezwebinupgrade.php script with –help param.
php bin/php/ezwebinupgrade.php --help
Step 5: Regenerate the autoload array for extensions
The autoload system has also some changes, for example the autoload array for extensions is now placed in var/autoload of your eZ Publish installation (along teh class changes in extensions itself).
To regenerate the autoload array, execute the following script from
php bin/php/ezpgenerateautoloads.php --extension
Step 6: Cache
Once the upgrade script is done, you need to clear the cache by executing following command from eZ Publish root folder:
php bin/php/ezcache.php --clear-all --purge
Łukasz Serwatka (26/05/2009 1:00 pm)
Ester Heylen (04/02/2010 2:47 pm)
Comments
PostgreSQL requirement
Wednesday 27 May 2009 6:30:49 am
Kristof Coomans
Maybe it's useful too mention here as well that the minimum version requirement of PostgreSQL has changed?
A note about clearing caches
Thursday 28 May 2009 1:40:12 pm
Gaetano
Explain "Install eZ Flow and WI separately"
Wednesday 10 June 2009 2:26:28 pm
Leif Arne Storset
Upgrade 4.0.3 to 4.1.3 eZ Flow problem
Thursday 02 July 2009 8:45:37 pm
Doug Brethower
For sites that started at 4.0.1, then are migrated to 4.0.3 prior to upgrade to 4.1.3, upgrade fails at the eZ Flow, eZ webin stage. "Faild .. err=1"
I believe I have traced the problem to eZ-Systems-eZ-systems duplication of folder names in /var/storage/packages. I think the installer for eZ Flow must have added the uppercase S folder prior to 4.0.3.
Surely there is a simple way to cure this problem. I have tried copying contents of uppercased S folder to lowercase s folder, deleting the extra folder and moved the error to a php error message about non-object reference on line 843
If anyone can relate simple fix, I doubt I am the only one who will bump into this.
Cheers.
Re: Upgrade 4.0.3 to 4.1.3 eZ Flow problem
Monday 13 July 2009 2:56:13 pm
Doug Brethower
settings/override/site.ini.append and set CheckValidity=true
The installer runs when site is next accessed. Include the eZ Flow extension, do not allow any changes to database. Has worked on a couple of problem sites so far.
ezwebin_setup-1.3.pdf for more thoughts and more complete instruction.
Re: Re: Upgrade 4.0.3 to 4.1.3 eZ Flow problem
Tuesday 14 July 2009 10:03:06 pm
Doug Brethower
Notice both an eZ-Systems and eZ-systems repository? That is the problem.
To fix.
Deleted the 1.0.2 or older version of ezflow_site from eZ-Systems repository.
ssh into site and remove the now empty eZ-Systems folder from var/packages
Reload package manager and note that eZ-Systems repository is gone, eZ-systems remains.
Download http://packages.ez.no/ezpublish/4.0/4.0.3/ezflow_site.ezpkg to local file system.
While still in package manager interface click button [Import new package], browse to and select the freshly downloaded package.
Check repositories again, and note that eZ-Systems was not re-created, rather the ezflow_site package version 1.0.3 resides in the eZ-systems repository.
Upgrade should now go smoothly.
One other note -- always check var/log/error.log for other potential problems before upgrades.
Autoload generation problem
Thursday 16 July 2009 10:57:20 am
Mathieu Richardoz
Of course, eZ-style, the call to token_get_all() fails silently (thank you mister @), so you could spend some time hacking around in the kernel to find this... ;-)
HTH.
Upgrade infinite loop?
Wednesday 05 August 2009 8:10:22 am
Piotrek Karaś
"If you are upgrading from version 4.0.3 or earlier, you need to first upgrade to 4.0.3 before you can upgrade to 4.1."
So once I upgrade to 4.0.3, I read this again, and it tells me again to upgrade to 4.0.3...
BTW. While I'm writing this comment, I'm no logger logged in... is it a cache problem or some other problem with the site?
Re: Upgrade infinite loop?
Wednesday 05 August 2009 6:19:33 pm
Doug Brethower
If memory serves, there is nothing to prevent proceeding past that notice and completing the upgrade. It is not so much "telling" you as notifying everyone. Please correct me if I am mistaken and I will dig through notes to provide better answer.
Cheers.
Object state script can be executed only once : addlockstategroup.php
Thursday 10 September 2009 3:29:29 pm
Gurudutt Verma
If you wish to execute this script again then do the following:
I required it today , because I did test upgrade last week and today I was doing final upgrade with latest database and then I just imported latest database to mysql without dropping the database and then many objects were missing the object state then I have to do above steps :-)
Update step is repeated
Friday 11 September 2009 3:54:10 pm
Kristof Coomans