Install on Ubuntu via DEB with MySQL not Postgres

Hi there,

I need to set up a new Zammad server to replace an old one that is poorly configured and running a MySQL database. I wish to export/import the database into the new server, so the new one must be MySQL too.

I am hosting the new server on Amazon AWS Lightsail.
I have experimented plenty and successfully installed with Postgres as default, on Ubuntu 18.04 via DEB. Elasticsearch is running and everything seems to be working better than my current install… just no data!

Is there a similar install procedure that will install with MySQL instead?

Below is my complete install procedure, after a fresh instance is set up with Ubuntu 18.04 OS Only, in Lightsail.

Many thanks
James

================================================================

sudo apt-get install apt-transport-https sudo wget
sudo echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get update
sudo apt-get install openjdk-8-jre elasticsearch
sudo /usr/share/elasticsearch/bin/elasticsearch -plugin install ingest-attachment
sudo sysctl -w vm.max_map_count=262144

sudo systemctl restart elasticsearch
sudo systemctl enable elasticsearch
curl -XGET http://localhost:9200/_status

su root
apt-get install apt-transport-https locales sudo wget
locale-gen en_US.UTF-8
echo "LANG=en_US.UTF-8" > /etc/default/locale
wget -qO- https://dl.packager.io/srv/zammad/zammad/key | sudo apt-key add -
sudo wget -O /etc/apt/sources.list.d/zammad.list \https://dl.packager.io/srv/zammad/zammad/stable/installer/ubuntu/ 

apt-get update
apt-get install zammad

sudo systemctl restart zammad

zammad run rails r "Setting.set('es_url', 'http://localhost:9200')"
zammad run rake searchindex:rebuild

sudo service nginx restart

Or is there a way I can change the above Postgres installation to use MySQL instead? Then import?

Thanks

You can either start from scratch and install MySQL-Server before installing the rest or simply install the MySQL-Server on the now already running machine.

You’ll need to handle things manuallier then…

Stop the Zammad service
You’ll need to adjust /opt/zammad/config/database.yml to hold the MySQL data.
You can find an exmaple here: https://github.com/zammad/zammad/blob/develop/config/database/database.yml#L21

Ensure your MySQL user may create databases (this makes it easier, you can drop this permission later on) and run:

zammad run rake db:create
zammad run rake db:migrate
zammad run rake db:seed

Now start Zammad and ensure it’s doing what you expect.
If you can talk to MySQL as expected (create data and stuff) you’ll be able to follow the backup process.

Heads up

The import process will overwrite local files and thus might also overwrite your database.conf - back it up before and put it back in place if needed!

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.