Package: zest.zodbupdate
zest.zodbupdatezodbupdate rename dictionary and dexterity patch for Plone 5.2 projects.Seepost on community.plone.org.
And thePlone ZODB Python 3 migration docs.Quick usageIn a simplifiedbuildout.cfg:[buildout]
parts =
    instance
    zodbupdate

[instance]
recipe = plone.recipe.zope2instance
eggs =
    Plone
    zodbverify

[zodbupdate]
recipe = zc.recipe.egg
scripts = zodbupdate
eggs =
    zodbupdate
    zest.zodbupdate
    ${instance:eggs}Runbin/buildoutand thenbin/zodbupdate-fvar/filestorage/Data.fs.Use case and processYou want to migrate your Plone 5.2 database from Python 2.7 to Python 3.
You use the zodbverify and zodbupdate tools for this.
When you first runbin/zodbverifyorbin/instance zodbverify, you may see warnings and exceptions.
It may warn about problems that zodbupdate will fix.
So the idea is now:First with Python 2.7, runbin/zodbupdate-fvar/filestorage/Data.fsSonopython3 convert stuff!
This will detect and apply several explicit and implicit rename rules.Then runbin/instance zodbverify.
If this still gives warnings or exceptions,
you may need to define more rules and apply them with zodbupdate.When all is well, on Python 3 run:bin/zodbupdate --convert-py3 --file=var/filestorage/Data.fs --encoding utf8For good measure, on Python 3 runbin/instance zodbverify.When this works fine on a copy of your production database,
you could choose to safe some downtime and only do step 3 on your production database.
But please check this process again on a copy of your database.Rename ruleszodbverify may give warnings and exceptions like these:Warning: Missing factory for Products.ResourceRegistries.interfaces.settings IResourceRegistriesSettings
Warning: Missing factory for App.interfaces IPersistentExtra
Warning: Missing factory for App.interfaces IUndoSupport
...
Found X records that could not be loaded.
Exceptions and how often they happened:
ImportError: No module named ResourceRegistries.interfaces.settings: 8
AttributeError: 'module' object has no attribute 'IPersistentExtra': 4508For each, you need to check if it can be safely replaced by something else,
or if this points to a real problem: maybe a previously installed add-on is missing.In this case, these interfaces seem no longer needed.
Easiest is to replace them with a basic Interface.
Maybe there are better ways to clean these up, but so far so good.You fix these with renames in an entrypoint using zodbupdate.
Seehttps://github.com/zopefoundation/zodbupdate#pre-defined-rename-rulesThe current package defines such an entrypoint.Here is the rename dictionary from themaster branch.
The warnings and exceptions mentioned above are handled here.
Each version of this package may have different contents.Dynamic dexterity schemasA special case thatbin/zodbupdateandbin/zodbverifymay bump into, is:AttributeError: Cannot find dynamic object factory for module plone.dexterity.schema.generated: 58
Warning: Missing factory for plone.dexterity.schema.generated Plone_0_Image
Warning: Missing factory for plone.dexterity.schema.generated Plone_0_Document
Warning: Missing factory for plone.dexterity.schema.generated Site2_0_News_1_Item
Warning: Missing factory for plone.dexterity.schema.generated Site3_0_DocumentThis is because no zcml is loaded by these scripts.
So this utility fromplone.dexterity/configure.zcmlis not registered:<utility
    factory=".schema.SchemaModuleFactory"
    name="plone.dexterity.schema.generated"
    />This utility implementsplone.alterego.interfaces.IDynamicObjectFactory.
This is responsible for generating schemas on the fly.
So we register this utility in Python code.Note that in normal use (bin/instance) this would result in a double registration,
but the second one is simply ignored by zope.interface, because it is the same.Also, when you have zodbverify in the instance eggs and you callbin/instance zodbverify,
you will not get this error, because then zcml is loaded, and no special handling is needed.Package structureThis package only has an__init__.pyfile.It has the rename dictionary pointed to by the entrypoint in oursetup.cfg.It is only loaded when runningbin/zodbupdate, because this is the only code that looks for the entrypoint.As a side effect, when the entrypoint is loaded we also register the dexterity utility when available.
This code is executed simply because it also is in the__init__.pyfile.Changelog1.0.0 (2020-07-24)Handle the return of webdav in Zope 4.3, especiallyIFTPAccessandEtagBaseInterface.
Fixesissue #1.
[maurits]1.0.0b2 (2020-03-25)Add renames for a few webdav interfaces.
In Zope 4.3 webdav will return, but until then they give real errors for zodbverify on Python 3.
[maurits]1.0.0b1 (2020-03-03)Initial release.  [maurits]