Updating Bitnami Docker Instances - TIP

Ask community to help.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
fdanna
TestLink user
Posts: 2
Joined: Tue Jun 18, 2013 6:34 pm

Updating Bitnami Docker Instances - TIP

Post by fdanna »

I just wanted to share the upgrade procedure that works for me with Bitnami Docker images. The procedure isn't exactly documented well except that they (bitnami) say to delete the containers, update the docker-compose file and then follow the standard Testlink upgrade procedures. This simply doesn't work.

This is what works reliably for me.

1. Do a dump of your existing DB (i.e. connect to your running instance of the testlink container -

Code: Select all

docker exec -it <testlink container> bash
and then issue

Code: Select all

mysqldump -u root -h mariadb bitnami_testlink > backup.sql
Note that these commands assume no password and that your db is called bitnami_testlink, the default.

2. Get the backup.sql and copy it outside of the container

Code: Select all

docker cp <container name>:<path>backup.sql .


3. Rather than try to backup the current containers, I just left them where they are and started a fresh instance of the new version from a different path. I created a directory called testlink1917 and launched edited my docker-compose.yml to pull the newer testlink container. In my case, I gave up on bind mounts and just switched to docker volumes.

4. After the new instance was up and running the following was critical for migration success: DELETE AND RECREATE THE DEFAULT DATABASE BEFORE RESTORING THE OLD DATA. I'm not a DB person and I had no idea that restoring the backup didn't overwrite everything. From inside the *new* testlink container:

Code: Select all

 mysql -u root -h mariadb 
and then

Code: Select all

drop database bitnami_testlink;
followed by

Code: Select all

create database bitnami_testlink;
exit the mysql prompt with

Code: Select all

exit
5. Now you can go ahead with restoring the data to the new mariadb. Still inside the new testlink container:

Code: Select all

mysql -u root -h mariadb bitnami_testlink < backup.sql
6. Lastly you'll want to apply the mandatary DB upgrade scripts provided by testlink. It took me a while to realize they are located conveniently inside the testlink container at

Code: Select all

/opt/bitnami/testlink_install/sql/alter_tables/<newTLversion>/mysql
After that you can move your custom_config.inc.php and upload_area folder as needed. This is the only procedure that works for me. I hope it saves someone a lot of headache!
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Updating Bitnami Docker Instances - TIP

Post by fman »

Thanks a lot for sharing!
Post Reply