How to do an RPM/repo install with MySQL (not Postgres)

Hello,

is it possible to do an RPM installation of Zammad from the repository but use MySQL instead of Postgres for Zammad? yum install zammad automatically installed Postgres and didn’t give me a choice. In the documentation I cannot find instructions on how to change this behaviour. Or can I change the behaviour immediately after the installation? It’s a clean install so far.

The background of the question is, that I would like to migrate a Zammad instance from a Debian system to a CentOS system. The installation on the Debian system is running with MySQL

I’d prefer an installation from the repository as this makes updates and upgrades much easier.

Thanks, Frank

Basically you run a normal Zammad installation like you did.
Technically you’ll then need to install a mysql server and client and adjust the database configuration (config/database.yml).
You can find a sample config here:

If you migrate an existing installation anyway, you technically don’t have to create and seed the db before. The import should do that for you. Heads up during restoration the database.yml is overwritten with the one from your backup!

If you struggle with dependencies Zammad sided, the source code installation may help you with hints. Not all those dependencies are required in a normal installation. Package installations by default come postgresql and mysql enabled.
https://docs.zammad.org/en/latest/install/source.html#prerequisites

Thank you very much, that’s very helpful.

Is such an installation also upgrade-safe? E.g. in the case of a future database structure change. Will this also work with yum update or does the package installation only upgrade/migrate the “built-in” database (i.e. postgres), leaving me to do the database migration manually?

Yes, this change is update safe!
The database.yml is being created during the first installation of a Zammad installation.

To be precise, this happens here:

Which gets called by https://github.com/zammad/zammad/blob/develop/contrib/packager.io/functions#L274-L300
during installations only.

Thanks lot - again :slight_smile: . Also for the technical explanations. This is very much appreciated.

2 Likes