Skip to content

Commit cc7f271

Browse files
committed
Add directions for mysql conversion for python 2.
Tried to summarize thoughts of roundup-devel mailing list thread: https://sourceforge.net/p/roundup/mailman/message/37019687/ subject: How does somebody upgrade to roundup 2.0 if using mysql? as well as emails by Joseph Myers on the python 3 requirements for mysql conversion. Will email roundup-devel to have people take a look.
1 parent e633953 commit cc7f271

File tree

1 file changed

+90
-1
lines changed

1 file changed

+90
-1
lines changed

doc/upgrading.txt

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,97 @@ Migrating from 1.6.X to 2.0.0
2929

3030
.. index:: roundup-admin; updateconfig subcommand
3131

32+
33+
Python 2 MYSQL users MUST READ
34+
------------------------------
35+
36+
To fix issues with encoding of data and text searching, roundup now
37+
explicitly sets the database connection character set. Roundup prior
38+
to 2.0 used the default character set which was not always utf-8. All
39+
roundup data is manipulated in utf-8. This mismatch causes issues with
40+
searches and result in corrupted data in the database if it was not
41+
properly represented across the charset conversions.
42+
43+
This issue exists when running roundup under python 2. Note that there
44+
are more changes required for running roundup 2.0 if you choose to use
45+
python3. See `Python 3 support`_.
46+
47+
In an upgraded ``config.ini`` (see next section) the ``[rdbms]``
48+
section has a key ``mysql_charset`` set by default to ``utf-8``.
49+
50+
It should be possible to change utf-8 to any mysql charset. So if you
51+
know what charset is enabled (e.g. via a setting in ~roundup/.my.cnf,
52+
or the default charset for the database) you can set it in
53+
``config.ini`` and not need to covert the database. However the
54+
underlying issues with misconverted data and bad searches will still
55+
exist if they did before.
56+
57+
None of the roundup developers run mysql, so the exact steps to take
58+
during the upgrade were tested with test and not production databases.
59+
60+
**Before doing anything else:**
61+
62+
Backup the mysql database using mysql dump or other mysql
63+
supported tool.
64+
65+
Backup roundup using your current backup tool and take the roundup
66+
instance offline.
67+
68+
Then the following steps (similar to the conversion in needed for
69+
Python 3) should work:
70+
71+
1. Export the tracker database
72+
using your **current** 1.6 instance::
73+
74+
roundup-admin -i <trackerdir> exporttables <export_dir>
75+
76+
replacing tracker_dir and export_dir as appropriate.
77+
78+
2. Import the exported database using the **new** 2.0 roundup::
79+
80+
roundup-admin -i <trackerdir> importtables <export_dir>
81+
82+
replacing tracker_dir and export_dir as appropriate.
83+
84+
The imported data should overwrite the original data. Note it is
85+
critically important that the ``exporttables`` be done with the *old
86+
tracker* and the ``importtables`` be done with the *new tracker*. An
87+
import/export cycle between roundup 1.6.0 and roundup 2.0 has been
88+
done successfully. So the export format for 1.6 and 2.0 should be
89+
compatible.
90+
91+
Note that ``importtables`` is new in roundup-2.0, so you will not be
92+
able to import the result of ``exporttables`` using any 1.x version of
93+
roundup.
94+
95+
Following the same sequence as above using ``export`` and ``import``
96+
should also work, but it will export all the files and messages. This
97+
will take longer but may be worth trying if the ``exporttables`` and
98+
``importtables`` method fails for some reason.
99+
100+
Another way that should be faster, but is untested is to use mysql
101+
dump to dump the database.
102+
https://makandracards.com/makandra/595-dumping-and-importing-from-to-mysql-in-an-utf-8-safe-way
103+
recommends::
104+
105+
Note that when your MySQL server is not set to UTF-8 you need to do
106+
mysqldump --default-character-set=latin1 (!) to get a correctly
107+
encoded dump. In that case you will also need to remove the SET
108+
NAMES='latin1' comment at the top of the dump, so the target machine
109+
won't change its UTF-8 charset when sourcing.
110+
111+
Then import the dump. Removing ``SET NAMES`` should allow the import
112+
to use UTF-8.
113+
114+
Please report success or issues with this conversion to the
115+
roundup-users AT lists.sourceforge.net mailing list.
116+
117+
As people report successful or unsuccessful conversions, we will update
118+
the errata page at: https://wiki.roundup-tracker.org/ReleaseErrata.
119+
32120
Upgrade tracker's config.ini file
33-
--------------------------------------
121+
---------------------------------
122+
34123
Once you have installed the new roundup, use::
35124

36125
roundup-admin -i /path/to/tracker updateconfig newconfig.ini

0 commit comments

Comments
 (0)