At Berlin Strategic sprint 2016 we developed a tool to analyze a ZODB Filestorage to find Python 2 string objects. If they are in an encoding besides ASCII this is preventing using this Filestorage with Python 3 because of decoding errors arising on loading the pickles.
The tool is even able to convert those strings either to unicode by decoding them using a configurable encoding or convert them to
zodbpickle.binary so Python 3 will read them as
There is documentation of the tool and a repository on GitHub where the code lives.
There are still some questions open:
- Is there already another tool for this analysis/migration?
- Is there already any practical knowledge migrating Filestorage contents to Python 3?
- Do you think such a tool is the right approach to achieve such a migration?
- Is there anyone who wants to try out the tool on a Filestorage of a personal project and share the experiences? (We analyzed two projects where we have access to a Filestorage but we are sure this does not catch all the edge cases.)
5 thoughts on “zodb.py3migrate: Migrate an existing ZODB Data.fs to be used with Python 3”
We are trying to migrate Data.fs from python2 to python3. your script is being useful, but we don’t get to the end.
Did you ever succeed?
This script was not yet used to migrate a Data.fs containing live data, because we do not have completely ported our applications to Python 3 yet. You might also have a look at https://pypi.org/project/zodbupdate/ which was successfully used to migrate the Data.fs of a GROK application.