I’ve hoped that migrating plone from 2.5.1 to 2.5.3 would be simple as a breeze but I ended up loosing 5h during my saturday.
Initially.
Initial configuration: plone 2.5.1 installed on zope 2.8.8 on gentoo. Production machine running 4 plone sites with various added products.
Try 1.
- backup everything
- download the plone 2.5.3 tgz
- create a backup of all plone related products
- copy the plone products into the zope products directory
- do a portal_migration for all the plone sites
- go to the add/remove products and upgrade installed products
- when trying to upgrade from linguaplone 0.9 to linguaplone 1.0 run into the following error
Traceback (most recent call last):
<br></br>
<br></br> File "/var/lib/zope/zope-solis/Products/CMFQuickInstallerTool/QuickInstallerTool.py", line 333, in installProduct
<br></br> res=install(portal)
<br></br>
<br></br> File "/usr/lib/zope-2.8.8/lib/python/Products/ExternalMethod/ExternalMethod.py", line 225, in __call__
<br></br> try: return f(*args, **kw)
<br></br>
<br></br> File "/var/lib/zope/zope-solis/Products/LinguaPlone/Extensions/Install.py", line 150, in install
<br></br> catalogtool.addIndex('Language', 'LanguageIndex')
<br></br>
<br></br> File "/usr/lib/zope-2.8.8/lib/python/Products/ZCatalog/ZCatalog.py", line 999, in addIndex
<br></br> raise ValueError, "Index of type %s not found" % type
<br></br>
<br></br>ValueError: Index of type LanguageIndex not found
<br></br>
- nothing seemed to fix this problem so after talking on the irc plone channel I was recomended to install at least zope 2.8.9 or better 2.9 from the plone universal installer
Try 2.
- install plone 2.5.3 from plone universal installer (including python, zope with zeo cluster: server + 2 clients)
- perform the upgrade procedure with the Data.fs from the upgraded version from Try 1.
- this time the LinguaPlone upgrade failed with the following error
Traceback (most recent call last):
<br></br>
<br></br> File "/opt/Plone-2.5.3/zeocluster/client2/Products/CMFQuickInstallerTool/QuickInstallerTool.py", line 333, in installProduct
<br></br> res=install(portal)
<br></br>
<br></br> File "/opt/Plone-2.5.3/lib/python/Products/ExternalMethod/ExternalMethod.py", line 225, in __call__
<br></br> try: return f(*args, **kw)
<br></br>
<br></br> File "/opt/Plone-2.5.3/zeocluster/client1/Products/LinguaPlone/Extensions/Install.py", line 152, in install
<br></br> catalogtool.reindexIndex('Language', None)
<br></br>
<br></br> File "/opt/Plone-2.5.3/lib/python/Products/ZCatalog/ZCatalog.py", line 506, in reindexIndex
<br></br> update_metadata=0, pghandler=pghandler)
<br></br>
<br></br> File "/opt/Plone-2.5.3/zeocluster/client2/Products/CMFPlone/CatalogTool.py", line 357, in catalog_object
<br></br> update_metadata, pghandler=pghandler)
<br></br>
<br></br> File "/opt/Plone-2.5.3/zeocluster/client1/Products/CacheSetup/patch.py", line 87, in catalog_object
<br></br> return call(self, 'catalog_object', obj, uid, idxs, update_metadata)
<br></br>
<br></br> File "/opt/Plone-2.5.3/zeocluster/client1/Products/CacheSetup/patch_utils.py", line 6, in call
<br></br> return getattr(self, PATTERN % __name__)(*args, **kw)
<br></br>
<br></br> File "/opt/Plone-2.5.3/lib/python/Products/ZCatalog/ZCatalog.py", line 567, in catalog_object
<br></br> update_metadata=update_metadata)
<br></br>
<br></br> File "/opt/Plone-2.5.3/lib/python/Products/ZCatalog/Catalog.py", line 360, in catalogObject
<br></br> blah = x.index_object(index, object, threshold)
<br></br>
<br></br> File "/opt/Plone-2.5.3/zeocluster/client1/Products/LinguaPlone/LanguageIndex.py", line 145, in index_object
<br></br> main, sub = splitLanguage(language)
<br></br>
<br></br> File "/opt/Plone-2.5.3/zeocluster/client1/Products/LinguaPlone/utils.py", line 304, in splitLanguage
<br></br> tag = tag.lower()
<br></br>
<br></br>AttributeError: 'NoneType' object has no attribute 'lower'
<br></br>
- I tryied everything including running the fixAccessors script (normaly needed when migrating from an older LinguaPlone product).
- In the end I managed to make LinguaPlone upgrade by modifying the utils.py script as follows:
def splitLanguage(tag):
<br></br> """Split a language tag (RFC 1766) into components
<br></br>
<br></br> Currently, this splits a language tag on the first dash *only*, and will
<br></br> not split i- and x- language tags, as these prefixes denote non-standard
<br></br> languages.
<br></br>
<br></br> """<br></br> #start modif <br></br> if tag is None:
<br></br> return (None, None)<br></br> #end modif<br></br>
- this way the upgrade of the LinguaPlone product worked but the fixAccessors script seemed to have ruined the language pages, failed again
Try 3.
- again with plone universal installer
- this time instead of using the Data.fs from the upgraded plone I used the Data.fs from the backup I did before starting everything
- upgraded plone in the new zope using the portal migration
- upgraded all products from the site setup interface using the modified LinguaPlone from try 2.
- now it worked. In the end I even found this article which convinced me about zeo with 2 clients
- finally I created an init script for the zeocluster shut down the production server and started the zeo client1 in it’s place.
#!/sbin/runscript<br></br><br></br>opts="start stop restart"<br></br><br></br>depend() {<br></br> need net<br></br>}<br></br><br></br>start() {<br></br> ebegin "Starting Zope in /opt/Plone-2.5.3/zeocluster"<br></br> /opt/Plone-2.5.3/zeocluster/bin/startcluster.sh<br></br> eend $?<br></br>}<br></br><br></br>stop() {<br></br> ebegin "Stopping Zope in /opt/Plone-2.5.3/zeocluster"<br></br> /opt/Plone-2.5.3/zeocluster/bin/shutdowncluster.sh<br></br> eend $?<br></br>}<br></br><br></br>restart() {<br></br> ebegin "Restarting Zope in /opt/Plone-2.5.3/zeocluster"<br></br> /opt/Plone-2.5.3/zeocluster/bin/restartcluster.sh<br></br> eend $?<br></br>}<br></br>
- success!