# MySQL 8.0.40 to MySQL 8.4.x on AWS RDS

This document outlines the procedure for migrating an Amazon Web Services (AWS) Relational Database Service (RDS) instance from **MySQL 8.0.40** to **MySQL 8.4.x**.\
The migration process is performed using the **AWS RDS Modify DB Instance** option. It ensures minimal downtime, data integrity, and compatibility with existing applications.

The procedure is designed for **System Administrators, DevOps Engineers, and Database Administrators** responsible for managing RDS-based MySQL deployments.

## Prerequisites

Before starting the migration, ensure the following conditions are met:

1. **Application downtime preparation**
   * Stop **Tomcat services** (or any dependent application services) that connect to the database.
2. **Database backup**
   * Take a **manual snapshot** of the RDS instance before applying the upgrade.
   * Verify automated backups are enabled for recovery.
3. **Access requirements**
   * AWS IAM permissions to modify RDS instances.
   * MySQL client installed on the administrator’s machine.
   * RDS endpoint, database username, and password.

## Migration Steps

1. **Capture Current Database Size**
   * Connect to the MySQL RDS instance and record the database size for validation after migration:

     ```bash
     mysql -h <RDS_ENDPOINT> -u <USERNAME> -p
     ```
   * Execute the following query:

     ```sql
     SELECT table_schema AS "Database",
            ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) AS "DB Size in MB"
     FROM information_schema.tables
     GROUP BY table_schema;
     ```

     \
     *Sample Reference Screenshot:*

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfVtHHnDFjPKFsrLwWYtwx8wLjtaqmjy27GMsGgOBnRgCZck1yve30aBs25LaZNZ0xq3E0L9ozRkVS6da15ky80l0xGI1WeZChmMcj32XspAopfwEuiPoIWM1hhiZvNEAPbQyUw1w?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>

2. **Assess Current Setup**
   * Identify the running RDS instance on **MySQL 8.0.40**.<br>

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc36PiW7ZCYB6jeKIhCrxrR5FuerlzyLaptex9qkYEUXyw_O9SDnTlwuCYq2Ebo0T0lrNsw4PmspZchA7TUUapXFM6WEyN_funpFg43QxiSdBWuzBMMEUOyrKGWYvv99B4H2SvyPw?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>
   * Confirm instance class, storage type, allocated storage, parameter group, and option group configurations.<br>

3. **Initiate Modification Process**
   * Open the **AWS Management Console → RDS Dashboard**.
   * Select the target RDS instance.
   * Click **Modify**.

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf3y47FxJj3FbZV7FnKu15JTAlbXt573uu1vSXAWcjltCDi7SOC6JM_lIUsdZV0C2OigX_VNi2onEcwUpEsdxJhduGG6qQia1TYWJ7BdHBaQpalzG6zWoqYsgTOFv09RppNG4RAlQ?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>

4. **Configure Instance Settings**
   * In the **DB Engine Version** field, select **MySQL 8.4.x** as the target version.

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd9kuFKHAgeKvtQLrveJoa-K3gSvNJHh4zJneTGP7f87WsaDBhcRu9uDZL2yB8MWahbS4bJ1UX4O8Vc31VT4IupRlia2LTPHCKPHzslrAD-wazoFCqjrigRJQtHdnG9JKfC4C345Q?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>
   * Retain the existing master username and password.

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcwBxdDT8PWGr5xFRLgQtgtXUwYXB3SU-4AhsGNaPC99qhCbqa78AOyrV4cHHPqybOo_roDqj-lhhDfrtyUGZWhkDsCFJ8ZXfJ0jwj1Baa7Wlw_k-pt5a2bZmJXbsqvsFaiAr_e?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>
   * Instance configuration (class, storage, connectivity) can remain unchanged unless capacity adjustments are required.

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcEJUgwJJC3mtLg-YDPWx4aw4imqEPXCfOuDi2VC_k4UFpK05Xbs7EtwGnYpItavgcpx2HVI4XQDMaAa6XxcAZ1gQPG3OBw82XIwxGAc9lnCDIQyrYlCvU7GsEaU4udj1htE2_CHQ?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>
   * Update the appropriate **Parameter Group** and **Option Group** to be compatible with MySQL 8.4.
   * Define a suitable backup and maintenance window.

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdPziusxN1Xjwy2g9O_ooHiiaPM4FGnvKKflEamnz8zUk1WO7icKzvGmcxXWrAxbYe8p7czdcaNL6Fbqwu5kN_UtXiVUtPescn_45fefjWTuOyx4k3LLlIZKVRg_wy-3T944deNDw?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>

5. **Verify Configuration**
   * Review all modifications carefully.

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfl8deXs_ClHArD7e9rCMXY4pB1wUf_dZMHwUIEHnAEdOIlaoGWqMpBbONcJaX248-EaZDpBQ77FcUC_UfMDs3W28VMGvePB8toph8G0QdrIkguOtWMQsqwPFjqvzVhqvtfVVF0UA?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>
   * Click **Continue** to proceed.<br>

6. **Apply Changes**
   * Compare the current and new values.

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeRGWCGT6xO19hud6f3WR9Rp24P1xA-_K3ICDWP3kX6UZL6NEmMh6qwPxzWyJKkd58SOy2R45dXy6d6SYm36Y8YqXX8t8jmHXe837m6Z-yBsNlrev7xdw_T1mkEuDPLvg4o49ZSGg?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>
   * Select **Apply Immediately**.
   * Click **Modify DB Instance** to trigger the upgrade.

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfcSixWay0as2U36UlrTiyGgvy6U2PJullXPw8M735MUMWKB3I439hJwA-7cfcPOa6UtTnrOmD8MpGdVGKTRQnkodSve-K0V7BTnXBREP3dLSjo_7dP4fSXaQDY8fm2br9Ko-wr?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>

7. **Wait for Migration**
   * The upgrade may take **15–20 minutes**, depending on instance size and workload.
   * During this period, the RDS status changes to **'modifying' and then returns to 'available' once the modification is complete**.

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdBSCCdSrmGAAl73NQNWX9R07HVjuxirikYtCD6EZbttlp9BMslltObFBhS8dSMa_gk-7YV36lDPqxzCawdbVj6qjpeZDZUJmtntMQJMG5PiRNfJk_VfY0yjT7WfmcTpeoBnXYUkg?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXftuXjJd6kPZarC82grIUO729aYIu2Ya8e1UYjBS4Z2TAbXAdkO1VHs7tQqvoIUg4uWJ1qWID_iYQjSmnKgkkfD0kxgxJTI8SMqFFhYmBZPBHlBWF9BCXflwUNsFL6Y5jp7Hb8ZNQ?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcIDJPbwV0wbWoZh9d8FxknWJylJyKU29kPULmEq8qrDp0m_XdKK0VvuUb5Mz5uCeFCHy7Zr8aKK_IwOfW9aOwVbDrTUya5ImYU_uz7PP_zEcNDOYY6h1ej91z-DyfguM5qX8-Nig?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>

8. **Confirm Migration**
   * After the RDS instance becomes available:
     * Verify the MySQL version:

       ```bash
       mysql -h <RDS_ENDPOINT> -u <USERNAME> -p -e "SELECT VERSION();"
       ```

       \
       *Sample Reference Screenshot:*

       <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfbv_8XdlrFigEFI0s1eJqzH2ayUaJsQ283HyQ0LlEm6ijSKKw314om5L1pjpqaQIoiIuQODtL5jxNVyFFXlKNWPDMRlV6mA5ZH1LkXRz64e2DVUEkaXkkhyvkKXCysWYZeR1B6?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>
     * Validate database size matches pre-upgrade snapshot:

       ```sql
       SELECT table_schema AS "Database",
              ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) AS "DB Size in MB"
       FROM information_schema.tables
       GROUP BY table_schema;
       ```

       \
       *Sample Reference Screenshot:*

       <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeIa4lKPF1eLbeEkUeI1ALTBD2MqOXXTeMyJ31pmmzeWY1v_NbNvUyGBFQH3XBjFrD-0r_ODGYdIcsA0GtbtXD_NaSnu3I0D9ro2iqidN1KThZmakJBJXJ4bUXru80SF0At2AuZLA?key=zx8yumD-RDhnfArFqP4nug" alt=""><figcaption></figcaption></figure>

9. **Restart Dependent Services**
   * Start the Tomcat services or any dependent application services that were previously stopped.
   * Perform application-level validation to confirm successful connectivity and functionality.

## Rollback Plan

If issues occur during or after the migration:

* **Restore from Snapshot**
  * Navigate to **RDS Console → Snapshots**.
  * Select the pre-upgrade snapshot and restore it as a new RDS instance.
* **Reconfigure Applications**
  * Point applications back to the restored RDS instance.
* **Investigate Upgrade Logs**
  * Review **RDS events** and **CloudWatch logs** for error details.

## Conclusion

The AWS RDS instance has been successfully migrated from **MySQL 8.0.40** to **MySQL 8.4.x**.\
The upgrade process preserved data integrity, ensured compatibility with applications, and leveraged AWS RDS-managed features for **high availability and reliability**.

***

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