Skip to content

Commit

Permalink
docker-compose: Upgrade from MariaDB 5.5 to MariaDB 10.3
Browse files Browse the repository at this point in the history
NOTE: we're upgrading b/c all of the new migrations introduce
schema altering operations which fail on older versions of
MariaDB!

WARNING:

kiwi_db_data volume mount dir changed from `/var/lib/mysql' to
`/var/lib/mysql/data' b/c the latest version of MariaDB uses
a different datadir setting!

HOW TO UPGRADE:

WARNING: upgrade your database BEFORE upgrading to Kiwi TCMS 8.0 !!!

1) Backup existing database with:

   docker exec -it kiwi_db mysqldump -u kiwi -pYourPass kiwi > backup.sql

2) docker-compose down
3) docker volume rm kiwi_db_data

   will remove existing data volume b/c of incompatibilities between
   different MariaDB versions

4) docker-compose up

   will recreate data volume with missing data. e.g. manage.py showmigrations
   will tell you that 0 migrations have been applied.

5) Restore the data from backup:

   cat backup.sql | docker exec -u 0 -i kiwi_db /opt/rh/rh-mariadb103/root/usr/bin/mysql kiwi

   note: this connects to the database as the root user

6) Proceed to upgrade your Kiwi TCMS container !
  • Loading branch information
atodorov committed Feb 10, 2020
1 parent 624eb59 commit 1195ef4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ version: '2'
services:
db:
container_name: kiwi_db
image: centos/mariadb
image: centos/mariadb-103-centos7
volumes:
- db_data:/var/lib/mysql
- db_data:/var/lib/mysql/data
restart: always
environment:
MYSQL_ROOT_PASSWORD: kiwi-1s-aw3s0m3
Expand Down

0 comments on commit 1195ef4

Please sign in to comment.