### Define Rename Rules in setup.py (Dictionary) Source: https://github.com/zopefoundation/zodbupdate/blob/master/README.rst Example of a Python dictionary defining class renames for zodbupdate. This dictionary should be referenced by an entry point. ```python rename_dict = { 'mypackage.mymodule ClassName': 'otherpackage.othermodule OtherClass'} ``` -------------------------------- ### Define Python 3 Decoders in setup.py Source: https://github.com/zopefoundation/zodbupdate/blob/master/README.rst When using --convert-py3, zodbupdate can load custom decoders from entry points. This example shows how to define the entry point for decoders. ```python setup(...) entry_points = """ [zodbupdate.decode] decodes = mypackage.mymodule:decode_dict """ ``` -------------------------------- ### Get zodbupdate Help Source: https://github.com/zopefoundation/zodbupdate/blob/master/README.rst Display detailed usage information and available options for the zodbupdate command. ```bash $ zodbupdate -h ``` -------------------------------- ### Run zodbupdate with FileStorage Source: https://github.com/zopefoundation/zodbupdate/blob/master/README.rst Use this command to update a database stored in a FileStorage file. Ensure the zodbupdate egg is installed in the environment. ```bash $ zodbupdate -f Data.fs ``` -------------------------------- ### Configure ZEO Client Storage Source: https://github.com/zopefoundation/zodbupdate/blob/master/README.rst Example ZConfig configuration file for connecting to a ZEO server. This file can be used with the -c option of zodbupdate. ```zconfig server 127.0.0.1:8100 storage 1 ``` -------------------------------- ### Run zodbupdate with Configuration File Source: https://github.com/zopefoundation/zodbupdate/blob/master/README.rst Use this command to update a database using a configuration file that defines the storage. This is useful for ZEO or other non-FileStorage configurations. ```bash $ zodbupdate -c zodb.conf ``` -------------------------------- ### Define Rename Rules in setup.py (Entry Point) Source: https://github.com/zopefoundation/zodbupdate/blob/master/README.rst Define rename rules for zodbupdate using an entry point in your setup.py file. These rules map old class names to new class names. ```python setup(...) entry_points = """ [zodbupdate] renames = mypackage.mymodule:rename_dict """ ``` -------------------------------- ### Configure zodbupdate with Buildout Source: https://github.com/zopefoundation/zodbupdate/blob/master/README.rst Integrate zodbupdate into your buildout configuration by adding it to the 'parts' and specifying the 'zodbupdate' egg in the buildout configuration. ```ini [buildout] parts += zodbupdate [zodbupdate] recipe = zc.recipe.egg eggs = zodbupdate ``` -------------------------------- ### Python 3 Migration Command Source: https://github.com/zopefoundation/zodbupdate/blob/master/README.rst Run zodbupdate with --pack and --convert-py3 to migrate a Python 2 ZODB database to be compatible with Python 3. This updates datetime, date, time objects, and ZODB references. ```bash zodbupdate --pack --convert-py3 ``` -------------------------------- ### Run zodbupdate for Python 3 Conversion Source: https://github.com/zopefoundation/zodbupdate/blob/master/README.rst Execute zodbupdate from within Python 3 to convert a Python 2 database. Specify a default encoding for unpickling strings. Strings are decoded according to explicit decoders, the command-line encoding, or stored as bytes if decoding fails. ```bash zodbupdate --pack --convert-py3 --encoding utf-8 ``` -------------------------------- ### Configure Attribute Decoders Source: https://github.com/zopefoundation/zodbupdate/blob/master/README.rst Define decoders as dictionaries to specify how attributes on Persistent classes should be encoded as bytes or decoded to unicode using a specified encoding. ```python decode_dict = { 'mypackage.mymodule ClassName attribute': 'binary', 'otherpackage.othermodule OtherClass other_attribute': 'utf-8'} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.