Path

ezpublish / documentation / ez publish / upgrading / upgrading to 4.7 / upgrading from 4.6 to 4.7


Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

Upgrading from 4.6 to 4.7

This section describes how to upgrade your existing eZ Publish 4.6 installation to version 4.7. Make sure that you have a working backup of the site before you do the actual upgrade, and make sure the installation you are performing the upgrade on is offline.

Important upgrade notes:

The procedure for upgrading directly from version 4.6 to 4.7 consists of the following steps:

  1. Upgrade the distribution files to 4.7
  2. Upgrade custom extensions
  3. Upgrade the database to 4.7
  4. Regenerate the autoload array for extensions
  5. Clear the caches
  6. Upgrade extensions

Check for requirements

The eZ Components and PHP requirements

The minimum version required of eZ Components with eZ Publish 4.7 is "ezcomponents-ezp47", containing a fix to the package. eZ Publish 4.7 is compatible with PHP version 5.2 and above. For more information regarding system requirements check out eZ Publish requirements.

Step 1: Upgrade the distribution files

The easiest way to upgrade the distribution files is to unpack eZ Publish 4.7 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 site accesses.

Important note: Because the new directory has replaced the original directory, the directory permissions need to be fixed. You have the choice between Shell commands or Alternative shell commands

Use the following commands to do this.

  • Shell commands

These shell commands will give proper permission to the web server:

cd </path/to/your/eZ/Publish/directory>
chmod -R a+rwx design extension settings var
  • Alternative shell commands

These commands will setup the permission more correctly, but require knowledge about the running web server.

chmod -R og+rwx design extension settings var
chown -R nouser:nouser design extension settings var

Step 2: Upgrade custom extensions

If you are using custom extensions, the sub-directories inside the "extension" directory will also have to be copied. However, make sure that you do not overwrite any extensions that are included in eZ Publish, which currently are eZ Flow (2.x) eZ Online Editor (5.x), eZ OpenOffice Document format (2.x), eZ JSCore (1.x), eZ Image Editor (1.x), eZ Comments (1.x), eZ Multiupload (1.x), eZ MB Password Expiry (1.x), eZ Network (1.x), eZ REST API Provider (1.x), eZ Script Monitor (1.x), eZ SI, ), eZ Find (1.x). 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 later.

See the dedicated upgrade instructions for eZ Flow and Website Interface below.
The updated versions of eZ Flow and Website Interface will also install the following extensions:

  • eZ Website Toolbar
  • eZ Star Rating
  • eZ Google Maps Location

Note: Both admin2 design and webin (ezwebin extension) require ezjscore extension to be enabled, look here for how to enable extensions.

Step 3: Upgrade the database

The update script for the database is located in

<eZ Publish root>/update/database/<mysqli|postgresql>/4.7/dbupdate-4.6.0-to-4.7.0.sql

You can run this with the appropriate command line tool or application.

Cluster

Since 4.7, the DB schema files can be found in kernel/sql/<db>.

Example:

/var/www/../kernel/sql/<db>

   |___ common

      |___cleandata.sql

   |___ mysql

      |___ cluster_db_schema.sql

      |___ cluster_dfs_schema.sql

      |___ cluster_schema.sql

      |___ kernel_schema.sql

Note: This is important when setting up a new instance.

Cluster Installation Index Setup

To setup the index part of a cluster installation, you have two files that contain the database AND cluster configuration settings. These settings are either in config.php or config.cluster.php.

Note: There are new settings, common to all clusters. You can see them on Cluster Configuration Settings (config.php / config.cluster.php).

You must follow the steps below in order to setup the index part of a cluster installation:

  1. Rename the existing index_cluster.php (version 4.6) to index_cluster.4.6.php (this was a manually created file, and it has to be renamed before upgrading, as it now exists in the distribution, and MUST NOT be changed)
  2. Follow the installation instructions on  Cluster Configuration Settings (config.php / config.cluster.php) applying your previous settings to the new configuration variables 

Important Note: Renaming and backing up the previous file must be done BEFORE replacing the distribution files.

Cluster Queries

Now, if you are using a DFS cluster, you must run the following query:

-- START: from 4.6.0 using DFS cluster setup
ALTER TABLE `ezdfsfile` CHANGE `datatype` `datatype` VARCHAR(255);
-- END: from 4.6.0 using DFS cluster setup

and if you are using a DB cluster, you ust run the following query:

-- START: from 4.6.0 using DB cluster setup
ALTER TABLE `ezdbfile` CHANGE `datatype` `datatype` VARCHAR(255);
-- END: from 4.6.0 using DB cluster setup

Note: The SQL script is located in eZ Publish distribution (update/database/mysql/4.7/).

Step 4: Regenerate the autoload array for extensions

The autoload system also has some changes, for example the autoload array for extensions is now placed in var/autoload of your eZ Publish installation (along the class changes in extensions itself).

To regenerate the autoload array, execute the following script from the root of your eZ Publish directory:

php bin/php/ezpgenerateautoloads.php --extension

Step 5: Clear 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:

  1. Navigate into the new eZ Publish directory.
  2. 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 sub-directories 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.

Step 6: Update rewrite rules

ezjscore extension previously had a file called index_ajax.php which was removed in 4.7. If you enabled this feature in the past you should now remove the following line or anything referring to index_ajax.php from your rewrite rules:

RewriteRule ^/([^/]+/)?ezjscore/call.* /index_ajax\.php [L]

Step 7: Upgrade extensions

When using eZ Webin and eZ Flow, these extensions will also need to be updated.

The first thing to do is to change the extensions permissions. An example on how this is done:

$chmod -R a+rwx extension

Mobile device detection

When upgrading from eZ Publish 4.6 to 4.7 and you are using eZ Flow, you can benefit from the new mobile device detection feature. Put the following settings in your "settings/override/site.ini.append.php" file:

[SiteAccessSettings]
[...]
DetectMobileDevice=enabled
MobileSiteAccessURL=http://example.com/iphone
MobileSiteAccessList[]
MobileSiteAccessList[]=iphone
[...]

An "iphone" siteaccess is provided out-of-the-box with your eZ Flow installation. Make sure that the MobileSiteAccessURL= points to the "iphone" site access. Note that this is a full URL and needs to include the http:// part.

The new object edit form in the Administration interface

While upgrading eZ Flow to the next release, you will have to replace the following override condition in "settings/siteaccess/<admin siteaccess>/override.ini.append.php". This is to adjust to the changes in the object edit form in the Administration interface.

[edit_frontpage]
Source=content/edit.tpl
MatchFile=edit/frontpage.tpl
Subdir=templates
Match[class_identifier]=frontpage

with this new one

[add_to_block_frontpage]
Source=content/parts/add_to_block.tpl
MatchFile=content/parts/add_to_block_frontpage.tpl
Subdir=templates
Match[class_identifier]=frontpage

The same operation may have to be done if the same override condition has been added for other class_identifier than "frontpage".

Next, depending on your own extensions, follow the steps mentioned in the eZ Webin and eZ Flow upgrade documentation.

Geir Arne Waaler (03/01/2012 8:42 am)

André R. (03/09/2012 2:11 pm)

André R., Andrea Melo


Comments

There are no comments.