[crossfire] Python 2 to 3 database conversion

Aeon aeonoris at gmail.com
Mon Aug 17 22:11:32 CDT 2020


This is for helping to get CF on Python 3.  There is an
incompatibility between the ways that Python 2 and 3 handle database
files.  Because of this, an existing server that updates to Python 3
will need to convert those database files as part of the update.

I assembled a list of database files that might be created by CF's
Python scripts.  This script (attached) should convert each database
on that list, and skip anything that either doesn't exist or already
has a converted database.  The new database files have ".db" appended
to the end of them, which Python3 should automatically give priority
over the old database files.  The old database files are untouched.

To use, you just put the file in the same directory as the databases
(default is the CF server's var/crossfire directory), and run it with
Python 2.7.  As a cautious person, I always recommend backups directly
before conversions like this, even though the old files are intended
to remain intact.

Let me know if it needs anything!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: py2-to-3_db-conversion_cf-rpg.py
Type: text/x-python
Size: 1862 bytes
Desc: not available
URL: <http://mailman.metalforge.org/pipermail/crossfire/attachments/20200817/c4f549fc/attachment.py>


More information about the crossfire mailing list