Re: [Trac] Converting from sqlite to mariadb/mysql
Bruce Dubbs <[email protected]> Thu, 5 Feb 2026 21:30:44 -0600
| Newsgroups | gmane.comp.version-control.subversion.trac.general |
|---|---|
| Message-ID | <[email protected]> |
On 2/5/26 8:39 PM, Jun Omae wrote: > Hi, >=20 > On Fri, Feb 6, 2026 at 10:37=E2=80=AFAM Bruce Dubbs <[email protected]= m> wrote: >> >> At the linuxfromscratch project we have been using Trac for a very long = time. The last time we updated Trac was in 2021 using the latest developme= nt system at that time. Over the years our sqlite databases have grown qui= te large: 287M, 884M, and 642M respectively. >> >> We have noticed some response problems and want to update to the latest = Trac and convert to mariadb. >> >> Doing some testing on a test server we installed python3.13, Trac-1.6, P= yMySQL, and mariadb-11.8.5. We then copied a current trac.db to the test sy= stem and ran sqlite3mysql to copy the trac.db into mariadb. >> >> We can log into mariadb with 'mariadb -u tracuser -p trac_db' and all l= ooks good. We do have a symlink /usr/bin/mysql -> mariadb >> >> We then edited the trac.ini file to read: >> >> #[sqlite] >> #extensions =3D >> ... >> [trac] >> ... >> #database =3D sqlite:db/trac.db >> #database =3D mysql://tracuser:password/trac_db?unix_socket=3D/run/maria= db/ >> mariadb.sock >> database =3D mysql://tracuser:password@localhost/trac_db >> >> but no matter what we try after restarting apache get the error message: >> >> TracError: Unable to check for upgrade of trac.db.api.DatabaseManager: T= racError: Unsupported database type "mysql" >> >> What are we missing? >=20 > I'd suggest to check errors in trac.log. The pymysql library is > required for MySQL but it is unavailable in your environment. I did look at trac.log. It just says the error message above. I also said above that pymysql is installed. I checked with: $ python3 Python 3.13.7 (main, Feb 3 2026, 16:47:05) [GCC 15.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pymysql without error. I tried the following: trac-admin /srv/trac/lfs convert_db mysql://tracuser:password@localhost/tra= c_db But got the following: /usr/lib/python3.13/site-packages/trac/__init__.py:14: UserWarning: pkg_res= ources is=20 deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resource= s.html.=20 The pkg_resources package is slated for removal as early as 2025-11-30. Ref= rain from=20 using this package or pin to Setuptools<81. from pkg_resources import DistributionNotFound, get_distribution Error: Unable to check for upgrade of trac.db.api.DatabaseManager: TimeoutE= rror:=20 Unable to get database connection within 10 seconds. > See also: https://trac.edgewall.org/wiki/SqLiteToMySql I did but it did not help By the way, this is a linuxfromscratch build. The above indicates to me th= at it is=20 looking for some commercial distribution like Debian or Fedora. I suspect I= need some=20 more detailed advice. --=20 You received this message because you are subscribed to the Google Groups "= Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to trac-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] To view this discussion visit https://groups.google.com/d/msgid/trac-users/= bb873af4-b929-4b63-8b5e-4571b7b03084%40gmail.com.