Skip to content

Draft: add optional script to migrate data to py3

Xiaowu Zhang requested to merge xiaowu.zhang/erp5:feat/py3_migrate_script into master

follow https://lab.nexedi.com/nexedi/erp5/-/merge_requests/2145#note_243116

one approach to convert all object might be to have an external script reading all records from the ZODB and if the pickle data has some python2 STRING, load and save again the object for this oid. Once this external script does not find any STRING, it means we no longer need zodbupdate. I guess this could be a way, we can try this.

we already have enable_zodbupdate_load_monkey_patch , which performs on-the-fly migration. Therefore, this script is optional.

It reads all records from the ZODB, and if the pickle data contains Python 2 strings, it loads and saves the corresponding object for that OID to explicitly migrate it to Python 3.

After running it, all records should be migrated to Python 3, allowing the system to run without enable_zodbupdate_load_monkey_patch

Edited by Xiaowu Zhang

Merge request reports