Weblate database switch to PostgreSQL
Upstream only wants to support PostgreSQL and kick out MySQL support. (see https://github.com/WeblateOrg/weblate/issues/2825, https://docs.weblate.org/en/latest/admin/install.html#database-setup)
Currently PostgrSQL is only recommend for new installation and existing users don't need to switch atm.
On the bugreport the have a link to a migration guide: https://www.calazan.com/migrating-django-app-from-mysql-to-postgresql/
For the record, we're getting repeated mysql lock timeout errors in the Weblate log (#17445).
I am not sure, though, if only switching to PostgreSQL would immediatelly solve those issues as I'm not sure such performance improvements are already implemented in Weblate in the version we're currently running (3.5.1).
Anyway, I think the best combo to do right now would be (1) upgrade to latest Weblate (#17345), (2) switch to PostgreSQL (this issue), and (3) tune Weblate config and the VM resources to guarantee the service works as expected (#17445). This way we'd be ready to welcome new performance related features when they are available in upstream.
#11 Updated by zen about 3 hours ago
Here is upstream documentation on migrating the database: https://docs.weblate.org/en/weblate-3.11/admin/upgrade.html#database-migration
And these are the rough steps I'm planning to do:
- Put Weblate under maintenance (to avoid modifications during the switch) -- probably modifying Nginx config.
- Add PostgreSQL and a database configuration to Puppet codebase.
- Add the new database configuration to Weblate config using Puppet.
- Manually export/import the database.
- Switch the database configuration in Weblate config using Puppet.
- Remove Weblate from maintenance.
- Remove the MariaDB database configuration from Weblate config in Puppet.