DEV Community

Antonios Thanasis
Antonios Thanasis

Posted on

Safely Upgrade a MySQL 5.7 -> 8.0 on Azure

Upgrading a production database? Don't test with the production application.

A safer approach:

Production
MySQL 5.7
   │
   │ Point-in-time restore
   ▼
Azure Test Database
MySQL 5.7
   │
   │ Upgrade
   ▼
Azure Test Database
MySQL 8.0
   ▲
   │
Local Laravel Application
Enter fullscreen mode Exit fullscreen mode

1. Restore production

Create a separate Azure MySQL server from a production restore point. The production server remains untouched.

2. Upgrade the test database

Upgrade the restored server from MySQL 5.7 → 8.0 and run the MySQL Upgrade Checker:

\js
Enter fullscreen mode Exit fullscreen mode
util.checkForServerUpgrade({
  targetVersion: "8.0.0"
})
Enter fullscreen mode Exit fullscreen mode

3. Test locally

Deploy your Application locally and point it to the Azure MySQL 8.0 test database.

Test:

  • Application functionality
  • Queries
  • Migrations
  • APIs
  • Queues and jobs
  • Reports

The workflow

Restore → Upgrade test DB → Run checks → Test with local app → Backup → Upgrade production.

This lets you test the real application against MySQL 8.0 without putting the production application or database at risk. 🚀

Top comments (0)