Upgrade eZ Publish 4.03 to 4.13
From 4.0.3 to 4.1.3 in particular on Mediatemple DV servers.
Upgrading eZ Publish with eZ Flow from version 4.0.3 to 4.1.3
A. **Very Important**
Login to admin interface->Setup->Upgrade Check-> click the buttons to verify the current site is consistent before proceeding. If not consistent, make a backup before making any changes.
B. **Very Important**
While still in admin interface->Setup->Packages and check for existence of both an eZ-Systems and eZ-systems repository. This can cause mysterious errors and head scratching, 3 lashes for whomever made the mistake in character case.
To fix.
Delete 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.
C. **Very Important**
Check var/log/error.log for errors before starting an upgrade, you may have some problems that are just waiting to manifest themselves. At the very least you will have a better understanding of any problems that seem to have mysteriously cropped up following the upgrade.
The problems may have been there all along, only when the upgrade institutes better error checking and reporting it appears the upgrade was the problem.
1. Use plesk to make a current site backup, keep the backup on the server until verified success.
a. Any problems or run out of time, click the backup file in plesk, then the "next" button to get right back to prior site.
2. Copy the upgrade archive file, into /httpdocs directory of the site,
a. Note the permissions settings on the existing files, permissons should match after the upgrade, generally your login is the owner of all the files, apache is the group for /design /extension /settings and /var
3. ssh into the site (ssh "ftplogin-name@255.255.255.255") and extract the archive, it will create it's own folder titled the same as the archive
# bunzip2 ezpublish-4.1.3.tar.bz
# tar xf ezpublish-4.1.3.tar
# rm ezpublish-4.1.3-gpl.tar
After the upgrade is extracted once into the hosting DV file structure, save time and bandwidth by copying it to other locations as needed if hosting multiple sites.
# cp -R ezpublish-4.1.3/ /var/www/vhosts/<sitename>/httpdocs/
Do not worry about the permissions for now, they will be set correctly near the end of these instructions.
4. http://ez.no/doc/ez_publish/upgrading/upgrading_to_4_1/4_0_x_to_4_1_y
a. Step 1, copy custom files from httpdocs root into the new folder
#cp -R design/ezflow_site/ ezpublish-4.1.3/design/
#cp -R design/admin/ ezpublish-4.1.3/design/admin/
#cp -R var/ ezpublish-4.1.3/
#cp -Rf settings/siteaccess/ ezpublish-4.1.3/settings/ --f so no overwrite prompts
#cp -R settings/override/ ezpublish-4.1.3/settings/ --answer y to any overwrite prompts
#cp -R extension/ezflow/ ezpublish-4.1.3/extension/
#cp -R extension/ezwebin/ ezpublish-4.1.3/extension/
Check the extension directory for any custom extensions and copy them into the upgrade following the pattern of ezflow and ezwebin.
Capture customizations, such as favicon and about box..
#cp design/standard/images/favicon.ico ezpublish-4.1.3/design/standard/images
#cp kernel/ezinfo/about.php ezpublish-4.1.3/kernel/ezinfo/
#cp design/standard/templates/ezinfo/about.tpl extension/ezflow/design/ezflow/override/templates/about.tpl (new template path locations upon upgrade)
Capture custom background running on the ezflow extension..
#cp extension/ezflow/design/ezflow/images/page-bg.jpg page-bg.jpg ..restore it from doc root after installing the ezflow extension to the update.
Many sites to upgrade, wrap the above commands into a shell script, and use /bin/cp in place of cp to avoid overwrite prompts, apparently cp runs aliased on MT DV server.
i. Take the site temporarily offline using plesk
b. Step 2, do the database updates in order from /updates/.. within the new folder, ie mysql
mysql -u <username> -p <database> < update/database/mysql/4.1/dbupdate-4.0.0-to-4.1.0.sql
This throws mysql errors because it presumes that all upgrades from time of 4.0.0 are needed. Can comment out the upgrades that have already been done from the file before it is run to prevent these errors, or edit the file to remove the offending lines each time an error is displayed. Run it until it completes without errors.
The the successive upgrades are straightforward. It is not explicitly stated in the eZ online upgrade instructions that they need to be run, but they need to be run.
mysql -u <username> -p <database> < update/database/mysql/4.1/dbupdate-4.1.0-to-4.1.1.sql
mysql -u <username> -p <database> < update/database/mysql/4.1/dbupdate-4.1.1-to-4.1.2.sql
mysql -u <username> -p <database> < update/database/mysql/4.1/dbupdate-4.1.2-to-4.1.3.sql
5. Regenerate the autoload arrays.
From the root of the upgrade folder /ezpublish-4.1.3/ run
# php bin/php/ezpgenerateautoloads.php --extension
.. if errors are generated, likely it was not run from the correct location or the eZ components are not installed http://ezcomponents.org/download/dl_components The ezc components are available built in to the download of the 4.1.3 and up versions, the with-ezc download file. The components may need to be installed into earlier versions. /ezc in the doc root appears to be the chosen path for these components. 28mb bz2 file, if no custom extensions, likely will not need them. May be easer to re-install the extensions into the newer version than install ezc.
..if a "PHP Warning: fopen(): SAFE MODE Restriction in effect" etc is displayed, from the upgrade folder
chown -R root *
SSH on mediatemple allows running as root. Depending upon how the files were unpacked, they may not be owned by root. When the files are subsequently copied from the upgrade folder to httpdocs, they will be owned by root, so chown root costs nothing and is a simple way around the fopen() restriction. php.net
6. Run system upgrade scripts in /update/common/scripts/4.1 per instructions
Run these from the root of the upgrade folder as well to keep paths lined up with what the scripts expect.
- addlockstategroup.php (used for creating locked states, part of the object states functionality)
- fixclassremoteid.php (fixing remote ids of classes)
- fixezurlobjectlinks.php (to fix older occurrences of link items not being present in the ezurl_object_table for all versions/translations)
- fixobjectremoteid.php (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)
7. Clear the caches from the /var content that was moved into the folder.
The script per the instructions typically spins out. Not sure if it is permissions or just takes too long to return result characters over ssh. Best to manually delete the /cache contents
In the upgrade folder var/cache directory--**be sure in correct directory**
#rm -R -f *
And then in the var/ezflow_site/cache directory and/or any other extension directories **DANGEROUS COMMAND IF RUN IN WRONG PLACE
#rm -R -f *
8. Upgrade eZ Flow and ezwebin.
From the upgrade folder root
#php bin/php/ezflowupgrade.php --to-version=1.1-0 --url=http://packages.ez.no/ezpublish/4.1/4.1.0
#php bin/php/ezwebinupgrade.php --to-version=1.4-0 --url=http://packages.ez.no/ezpublish/4.1/4.1.0
If you run into the problem "Error: Faild to import 'ezflow_classes' package: err = 1" or something similar for ezwebin, below is a tip that can save you a couple of hours.
*****eZ-Systems or eZ-systems????**************
Check for the existence of eZ-Systems and eZ-systems in the /var/storage/packages/ and review B. Very Important above.
The lower-case s is the default for new installations. Upgrades from 4.0.1 in particular may have the upper-case S structure.
*********************************************************
9. Regenerate the autoload array for extensions a second time to pick up any eZ Flow-ezwebin classes
#php bin/php/ezpgenerateautoloads.php --extension
10. Clear the caches a second time.
Because building the autoloads for the extensions throws items into /var/cache.
This seems like duplication, but if caches are not cleared prior to ezwebin-ezflow upgrades there will be problems. So yes, it must be done twice as per these directions.
10.A If running custom adserver banners..
#cp extension/ezflow/design/ezflow/override/templates/block/banner*.tpl ezpublish-4.1.3/extension/ezflow/design/ezflow/override/templates/block
11. delete all files except .htaccess and the newly created folder from the site
cd back to the root of the site, httpdocs/ and ..
# rm -R -f var/ update/ support/ share/ settings/ schemas/ packages/ lib/ kernel/ autoload/ bin/ cronjobs/ design/ doc/ extension/
# rm -f access.php autoload.php ezpm.php ezpublish.cron index.php index_* kickstart.ini-dist pre_check.php runcronjobs.php soap.php webdav.php
Site should contain only .htaccess and ez_publish-4.1.x folder, maybe a few other custom files or directories you have created. DV has some files and folders it creates by default, best to leave them.
12. Copy all the files out of the folder and up into the root of the httpdocs folder
cd ez_publish-4.1.3
cp -R * /<root path>/httpdocs/
Answer y to overwrite prompts for License and README files to get the latest versions.
If copied the page-bg.jpg to root of site, copy it back into the correct location
#cp page-bg.jpg extension/ezflow/design/ezflow/images/
13. Check file permissions,
likely will need to..
#cd .. to move up into the document root
# chown -R <username> *
# chgrp -R psacln *
# chgrp -R apache var/ extension/ settings/ design/ autoload/
# chmod -R 770 var/ extension/ settings/ design/ autoload/
Fix permissions on custom about box template..
#chown <username> extension/ezflow/design/ezflow/override/templates/about.tpl
#chgrp apache extension/ezflow/design/ezflow/override/templates/about.tpl
Any future problems will iikely be caused by incorrect permissions settings.
14. Re-enable the site in plesk.
Restart your favorite browser and browse to the admin page of the site, should see the 4.1.3 version after the eZ Publish logo. Clear all caches for good measure.
If Access denied pops up..
edit /settings/override/site.ini.append.php to add or alter debug settings.
[DebugSettings]
DebugOutput=enabled
..fix whatever the debug says needs fixed, then..
[DebugSettings]
DebugOutput=disabled
when everything is working.
Try a different browser or reloading the browser in admin once in a while, updates may happen on the DV server, but be cached locally making it appear problems still exist, when in fact problems are cleared.
15. Browse all over the site to get the caches re-built.
When satisfied site has been successfully upgraded, delete the folder containing the extracted archive and make another Plesk backup to save the upgraded state.
16. Delete the file structure that was used to update the site.
# rm -Rf ezpublish-4.1.3/
17. If no neat editor icons in the editor window, probably ezoe has not been enabled.
Setup->Extensions-> checkmark ezoe and click apply changes.
Then should see a very ajaxified interface for editing documents. Works in Safari as well, the old editor did not.
