I'm trying to upgrade Plone 5.2.6 site to 6.0.5 and got this error:
Control panel imported.
Ran upgrade step: Run to6000 upgrade profile.
Removed broken temp_folder from Zope root.
Removed temp_folder from Zope root _mount_points.
Ran upgrade step: Remove broken temp_folder / tempstorage / Products.TemporaryStorage
Ran upgrade step: Fix UUID for DX Site Root
Ran upgrade step: Index the Site Root
Upgrade aborted. Error:
Traceback (most recent call last):
File "/app/lib/python3.11/site-packages/Products/CMFPlone/MigrationTool.py", line 299, in upgrade
step['step'].doStep(setup)
File "/app/lib/python3.11/site-packages/Products/GenericSetup/upgrade.py", line 193, in doStep
self.handler(tool)
File "/app/lib/python3.11/site-packages/plone/app/upgrade/v60/alphas.py", line 175, in fix_unicode_properties
portal.ZopeFindAndApply(portal, search_sub=1, apply_func=fix_properties)
File "/app/lib/python3.11/site-packages/OFS/FindSupport.py", line 171, in ZopeFindAndApply
self.ZopeFindAndApply(ob, obj_ids, obj_metatypes,
File "/app/lib/python3.11/site-packages/OFS/FindSupport.py", line 165, in ZopeFindAndApply
apply_func(ob, (apply_path + '/' + p))
File "/app/lib/python3.11/site-packages/ZPublisher/utils.py", line 147, in fix_properties
if not hasattr(obj, "_updateProperty"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site-packages/ZODB/Connection.py", line 792, in setstate
self._reader.setGhostState(obj, p)
File "/app/lib/python3.11/site-packages/ZODB/serialize.py", line 639, in setGhostState
state = self.getState(pickle)
^^^^^^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site-packages/ZODB/serialize.py", line 632, in getState
return unpickler.load()
^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site-packages/ZODB/broken.py", line 109, in __new__
result = object.__new__(class_)
^^^^^^^^^^^^^^^^^^^^^^
TypeError: object.__new__(RetainATRefs) is not safe, use Persistence.Persistent.__new__()
End of upgrade path, main migration has finished.
The upgrade path did NOT reach current version.
Migration has failed
The original site has no third party packages installed just a vanilla Plone instalation. Also tried to migrate to 6.0.4, but same result.
Juan Carlos via Plone Community wrote at 2023-6-19 14:01 +0000:
...
File "/app/lib/python3.11/site-packages/ZODB/Connection.py", line 792, in setstate
self.reader.setGhostState(obj, p)
File "/app/lib/python3.11/site-packages/ZODB/serialize.py", line 639, in setGhostState
state = self.getState(pickle)
^^^^^^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site-packages/ZODB/serialize.py", line 632, in getState
return unpickler.load()
^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site-packages/ZODB/broken.py", line 109, in new
result = object.new(class)
^^^^^^^^^^^^^^^^^^^^^^
TypeError: object.new(RetainATRefs) is not safe, use Persistence.Persistent.new()
Errors of this kind usually mean that derivation from Persistent has
changed, i.e. a class which formerly has not been derived from Persistent now is. The ZODB cannot handle such changes.
The AT infix hints towards ArcheTypes. It is possible
that the migration does not expect that RetainATRefs objects still exist
in the ZODB.
It might be necessary to remove those objects before
the migration.
You need to migrate your Archetypes based content types to Dexterity first in your Plone 5 installation (latest Plone 5 version). There is a tool for that, just call /@@atct_migrator on your Plone site root.
I am sure that there is no archetypes content in the site, since I already migrated the archetypes 5 years ago. Furthermore, when I made the first attempt to migrate the site form 5 to 6, a couple of weeks ago, it worked.
I wanted to make a new migration because there are have been some new content created in the old site (maybe 5 pages and some permissions changed), but after the problem I have now with the migration I will stay with my first migration and add the changes by hand.
I will inform if I discover the reason of this fail.
Thanks petschki, you pointed me in the right direction, finally I was able to migrate the site, but I don't know why my first migration worked.
This is what I made:
Following the script at removeBrokenModifiers I executed the following from inside a debug session:
from zope.component.hooks import setSite
from plone import api
import transaction
portal = app['Plone']
setSite(portal)
tool = api.portal.get_tool(name='portal_modifier')
tool._delObject('RetainATRefs')
tool._delObject('NotRetainATRefs')
tool._delObject('SkipBlobs')
transaction.commit()
The original removeBrokenModifiers function didn't work because the modifier didn't have the isBoken method (line 54), I don't know why. Finally I decided to do it manually.