r/webdev • u/Chrono_Wolf • 2d ago
Question Upgrading MySQL 5.7 → 8.0 on shared hosting (a live WordPress site AND my custom-coded site sharing the same DB). How do I not break the client's business?
This is my first site that I'm deploying myself (someone else always handled this before), and it's for a small business, so a failure has real consequences for the owner.
Setup:
- Shared hosting at Aruba (Italy), Percona Server 5.7.44, one MySQL service with 5 databases but only one is used (~13 MB, utf8mb4_unicode_ci, server charset latin1)
- Live site: WordPress 7.1.5, PHP 8.0.30 (will be bumped to the latest PHP at release)
- The site I'm deploying is pure custom code. It connects to the same database as the live WordPress site (but read/write a different db in the same mysql group).
- The host's panel has an "Upgrade version" button for 5.7 → 8.0. They explicitly say there is NO downgrade, and the service expires in 3 weeks.
The WP site has ~20 plugins, many outdated, including a custom booking plugin with no update channel (the core of the business), an old Slider Revolution without a license, WPBakery 7.3, Meta Box 5.9, and a currency switcher for WooCommerce.
My priorities and fears:
- The DB comes first. I'm afraid the upgrade will break WP settings/serialized options or custom tables, and that a 5.7 dump isn't enough of a safety net.
- Since rollback is impossible, I want to be sure the backup actually restores.
- I'm changing PHP and MySQL in the same release and want to avoid not knowing which one broke what.
Questions:
- Does an in-place 5.7 → 8.0 upgrade normally preserve everything (wp_options, serialized data, custom tables, triggers)? Which MySQL 8 differences should I check for in both WP plugins and my own code (reserved words, GROUP BY ordering, sql_mode, collation, charset)?
- What's the right mysqldump setup for this, and how do I truly validate the backup before upgrading (I have empty spare DBs on the same service)?
- With a DB shared between WP and my custom code, what's the safest order: PHP first, DB later? Staging on the same server using a copy of the DB, or locally with Docker (mysql:5.7 vs mysql:8.0)?
- Any experience with unmaintained plugins breaking on MySQL 8, and how would you test them before touching production?
Thanks, any checklist or war story is welcome.
