MySQL Upgrade from 8.0.4 to 8.4.x (Ubuntu)

This article provides step-by-step instructions to upgrade MySQL from version 8.0.4 to 8.4.x. It covers prerequisites, pre-upgrade checks, installation steps, post-upgrade validations, and rollback procedures to ensure a safe and production-ready upgrade.

Prerequisites

  • OS Compatibility

    • Confirm the operating system supports MySQL 8.4.

    • Recommended: Ubuntu 22.04 LTS or later.

    • Check OS version:

      cat /etc/os-release
  • System Requirements

    • Disk space: Sufficient for backups and rollback

    • Memory: Minimum 16 GB RAM

    • Access: Root or sudo privileges

Pre-Upgrade Checks

  • Backup

    • Logical backup:

      mysqldump -u root -p ovaledgedb > /home/ubuntu/mysql_backup/ovaledgedb_backup.sql

      Ensure you use the correct schema.

    • Physical backup (recommended):

      • Use Percona XtraBackup or filesystem-level copy.

    • Backup configuration files:

      sudo cp /etc/mysql/mysql.conf.d/mysqld.cnf /home/ubuntu/mysql_backup/
      sudo cp -a /var/lib/mysql /home/ubuntu/mysql_backup/
  • Collect Pre-Upgrade Database Information

    • Database size query:

      SELECT 
          table_schema AS "Database Name", 
          ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) AS "DB Size (MB)"
      FROM information_schema.tables 
      GROUP BY table_schema;
    • Row count query: [Download Query File]

    • Save query outputs for post-upgrade validation.

Upgrade Execution

  • Stop MySQL Service

  • Download MySQL APT Repository

  • Update package manager repo i,e, using deb packages for ubuntu.

  • Update Repository Update the deb packages as shown below.

    • Select the highlighted package below and hit Enter.

    • Select MySQL 8.4 LTS when prompted.

    • Confirm selections and continue.

    • Finally you will get below screen,

  • Update Packages Update the apt package repository.

  • Upgrade MySQL Server Run the following command to upgrade the MySQL server:

  • Update Configuration Open the MySQL configuration file:

    Add:

    Save file and restart MySQL

  • Verify Version

Post-Upgrade Validations

  • Row Count Verification

    Run [Row Count Query] and compare results with pre-upgrade counts.

  • Database Size Verification

    Compare with pre-upgrade values.

  • Update MySQL Parameters Edit /etc/mysql/mysql.conf.d/mysqld.cnf and add:

    Adjust values based on instance size. Restart MySQL:

  • Update OvalEdge User Password

  • Check Logs

  • Once validations are complete, point the OvalEdge application to MySQL 8.4.

Rollback Plan (If Needed)

  • Back up MySQL configuration and data directory:

  • Stop MySQL service.

  • Reinstall MySQL 8.0.4.

  • Restore data from backups.

Additional Information

  • Test MySQL 8.4 installation in a separate folder before applying in production.

  • Example: MySQL 8.4.4 installation in a separate folder on Ubuntu.


Copyright © 2025, OvalEdge LLC, Peachtree Corners, GA, USA.

Last updated

Was this helpful?