Upgrading to TLD Linux 2024.01

Note: only upgrade from TLD Linux 2019.01 is supported. If you are running older version of TLD Linux you may try to follow an upgrade path of “one version at the time”, but we strongly recommend to perform clean install of TLD Linux 2024.01 instead.

About TLD 2024.01

Version 2024.01 of TLD Linux introduces some big changes that you should be aware of before upgrading your systems.

First, the content of the distribution has been heavily stripped down to limit the time and resources needed for maintenance and development. This was a necessary step, and the alternative was to close the project completely.

In fact, TLD Linux is currently a microdistribution with a limited set of packages. It is still focused on the server environment and can still happily run your servers and services… if they are still supported.

Secondly, you need to know that all packages have been rebuilt from scratch for better library compatibility and compatibility with the newer RPM version. This means that the update to version 2024.01 will completely replace any package that is still supported.

Third, there is some work you need to do on your systems before you can upgrade…

Prepare to upgrade


As usual the first step you should do is to perform full backup of your system so you will be able to revert back if something goes wrong.

RPM and poldek


Before you will be able to upgrade the system it is required to upgrade RPM and poldek to new versions. First, make sure that your poldek indexes are up to date:

poldek --upa

You may need to remove some conflicting packages:

poldek -e python-rpm rpm-pythonprov rpm-specdump systemtap-client

And finally you may perform the upgrade:

poldek -u rpm poldek

MySQL


As support for MySQL 5.7 ended in October 2023, it is no longer available on TLD Linux. Additionally, MySQL packages have been modified to be co-installable, so you can run multiple versions in parallel if necessary (like we did with PostgreSQL in TLD Linux 2018.02).

For this reason, you must migrate to MySQL 8.0 before upgrading your system, otherwise you may irreversibly damage your MySQL installation. There are two ways to migrate your databases, manually or automatically.

We do not recommend a manual migration. It is a bit complicated and time consuming process. Use it only if automatic migration fails.

Note: migration assumes that you use single MySQL cluster. If you have multiple clusters you must migrate all of them.

Automatic migration

1. Stop MySQL 5.7 on your server:

service mysql stop

2. Copy away and/or backup following folders:

  • /etc/mysql
  • /usr/share/mysql
  • /var/lib/mysql
  • /var/log/mysql
  • /var/log/archive/mysql

3. Install MySQL 8.0 libraries to prevent automatic removal of pacakges which depend on “mysql-libs”.

poldek -i mysql-8.0-libs

4. Remove all MySQL packages from system:

poldek --cmd "uninstall mysql-*"

5. Remove following folders:

  • /etc/mysql
  • /usr/share/mysql
  • /var/lib/mysql
  • /var/log/mysql
  • /var/log/archive/mysql

6. Install MySQL 8.0:

poldek -i mysql-8.0 mysql-8.0-client

7. Initialize MySQL 8.0 cluster:

service mysql-8.0 init

8. Remove contents of newly created cluster:

rm -rf /var/lib/mysql/8.0/main/mysqldb/*

9. Copy or restore contents of old /var/lib/mysql/mysqldb/ to /var/lib/mysql/8.0/main/mysqldb/

10. Start MySQL 8.0 (this may take some time as automatic cluster upgrade will be run):

service mysql-8.0 start

11. If MySQL 8.0 has started then migration was probably successful. Please check /var/log/mysql/8.0/mysqld.log for details to confirm that MySQL cluster data have been successfuly upgraded or to find reasons of failure. You should see something like this:

2024-03-31T18:56:20.136830Z 0 [System] [MY-010116] [Server] /usr/lib64/mysql/8.0/sbin/mysqld (mysqld 8.0.35) starting as process 2884
2024-03-31T18:56:20.174510Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory.
2024-03-31T18:56:20.174611Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-03-31T18:56:20.639578Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-03-31T18:56:23.061789Z 2 [System] [MY-011003] [Server] Finished populating Data Dictionary tables with data.
2024-03-31T18:56:24.023143Z 5 [System] [MY-013381] [Server] Server upgrade from '50700' to '80035' started.
2024-03-31T18:56:28.379152Z 5 [System] [MY-013381] [Server] Server upgrade from '50700' to '80035' completed.

12. Optionally make adjustments to MySQL 8.0 config to match your requirements and reload MySQL 8.0 service to apply the changes.

Manual migration

1. Make a full backup of all of your databases using mysqldump command. This will not be covered here, there are plenty of howtos available online.

2. Stop MySQL 5.7 on your server:

service mysql stop

3. Remove all MySQL packages from system:

poldek --cmd "uninstall mysql-*"

4. Move away or remove following folders:

  • /etc/mysql
  • /usr/share/mysql
  • /var/lib/mysql
  • /var/log/mysql
  • /var/log/archive/mysql

5. Install MySQL 8.0:

poldek -i mysql-8.0 mysql-8.0-client

6. Initialize MySQL 8.0 cluster:

service mysql-8.0 init

7. Restore your databses from your backups. Manually recreate all users and their privileges.

© TLD Linux