📘 MySQL only supports upgrade between General Availability releases, so upgrading multiple versions (i.e. 5.6 => 8.0) requires going through the upgrade process multiple times.
mysqldump
and mysql
client tools.
📘 If you’re performing the test to get an estimate of how much downtime is required to perform the upgrade, you’ll need to dump the restored Database twice in order to get an accurate time estimate. The first time will ensure that all of the backup data has been synced to the disk. The second backup will take approximately the same amount of time as the production dump.
SOURCE_HANDLE
- The handle (i.e., name) of the Database.
SOURCE_ENVIRONMENT
- The handle of the environment the Database belongs to.
TARGET_HANDLE
- The handle (i.e., name) for the Database.
TARGET_VERSION
- The target MySQL version. Run aptible db:versions
to see a full list of options. This must be within one General Availability version of the source Database.
TARGET_ENVIRONMENT
- The handle of the environment to create the Database in.
APTIBLE_OUTPUT_FORMAT=json aptible apps
.
Example:
aptible db:tunnel
. Then dump the database and database object definitions into a file. dump.sql
in this case.
mysqldump 8
. You can disable this flag and resolve the error by adding --column-statistics=0
to the above command.
You now have a copy of your Database’s database object definitions in dump.sql
! The Database Tunnel can be closed by following the instructions that aptible db:tunnel
printed when the tunnel started.
📘 If there are any errors, they will need to be addressed in order to be able to upgrade the source Database to the desired version. Consult the MySQL Documentation for details about the errors you encounter.
$TARGET_ENVIRONMENT
is configured to retain final Database Backups, which is enabled by default, you may want to delete the final backup for the target Database.
You can obtain a list of final backups by running the following:
aptible backup:purge
command.
aptible config:set
command.
Example: