In our previous article we discussed differences between MySQL vs. MariaDB as Relational Database Management Systems (RDBMS) for your enterprise-grade website or application.
What is the next step after you decide to make the move into MariaDB?
That is where we land now. cPanel servers typically kick off with MySQL already setup and configured by default, so the question at-hand becomes how do you make the switch? We will get into this and more with our guide to upgrading your cPanel server from MySQL to MariaDB.
- Preparation & Requirements:
- Step #1: Enable Maintenance Mode
- Step #2: Login To The WHM Interface
- Step #3: Locate “MySQL/MariaDB Upgrade” Tool
- Step #4: Choose A MariaDB Version To Install
- Step #5: Review Additional Warning Messages
- Step #6: Unattended vs. Interactive Upgrades
- Step #7: Monitor The Upgrade Log
- Step #8: Finished – Wrapping Up
Preparation & Requirements:
Before we get started, here is a quick check list of what we will need to make sure we have before proceeding with converting your MySQL database to MariaDB via cPanel.
- Required Access Level: Root
- Required Interface Access: WHM
- Requires Downtime: Yes, less than 15 minutes.
- Recommended Event Window Size: 1 Hour
- A Prepared Testing Strategy: A list of links, and features on the server that should be tested before and after the maintenance event.
Schedule A Proper Maintenance Window
Before you plunge into the icy cold waters of regret, we should first practice proper server maintenance etiquette to reduce the impact these disruptive changes have on the server population.
This procedure requires the complete removal of MySQL binaries from the server before MariaDB binaries can be installed. Translated, this means all websites dependent on their databases will break during this installation procedure.
This process is usually very fast, measured in minutes. However, this depends on a number of outside factors as well which make this hard to predict exact time lines. Some examples of these outside factors are:
- Server population size
- Total number of tables
- Total length of tables
- Server Hardware
- The current level of activity on the server.
These factors vary from day to day, hour to hour, and server to server. So we should plan to perform this task only during a properly scheduled, off-peak hours, downtime event window.
Always Backup First
A simple yet necessary rule. These changes can be difficult to undo, especially when it comes down to the end of a maintenance period and the changes cause errors or performance troubles. So a critical step in every good maintenance plan is to ensure there is a backup of the system’s current state before moving forward with making changes.
The exact process for this will depend on your particular backup solution. So you won’t find those instructions here. You will need to refer to that products documentation to plan out your exact pre-maintenance backup and restore procedures.
Always Have A Back-out Plan
Every good maintenance plan not only has a backup, but also has as much of the back-out procures planned out in advance. This way there is no question on how to proceed during crunch time when the decision is made to undo the changes. These optional steps should also include a deadline timeframe or condition outlining when the decision to abandoned the upgrade should be executed.
Example: “If not working by 4:45 AM, begin back-out procedures.”
Step #1: Enable Maintenance Mode
Most enterprise-grade websites run on a framework like WordPress, Joomla, Magento, etc…. These systems have a maintenance mode that should be enabled when executing disruptive work on a server. These modes are designed to display simple HTML pages instead of throwing errors and allow the site owners to customer the downtime experience for their websites. More importantly, these modes will prevent any kind of database activity from potentially interfering with the upgrade. This preserves the integrity of the database data, ensuring that no partial or aborted write operation can corrupt a table.
Note: Ideally, Maintenance mode should be enabled on every website that supports it to prevent potential database corruption resulting from partial writes.
Step #2: Login To The WHM Interface
Point your browser to the WHM URL of your server (i.e. https://hostname.or.ipaddress:2087) or you can use one of the following redirection URLS for easier remembrance.
- http://my.server.ip/whm
- http://my.server.hostname/whm
Note: You may need to accept an SSL security warning if your server does not have a valid host certificate issued and installed for your WHM interface. You will also see these types of warnings if you are visiting the WHM interface with an IP address due to certificate vendors denying certificate issues for IP addresses.
Once you reach the login page, simply input your root user and password and click the [Log in] button.
Step #3: Locate “MySQL/MariaDB Upgrade” Tool
Locate and click on the “MySQL/MariaDB Upgrade” tool. You will find this tool linked on the left hand navigation panel under the “SQL Services” section or by simply typing “maria” in the quick search box to narrow down the results.
Step #4: Choose A MariaDB Version To Install
Review the warning and information text and when you’re ready to continue, enable the radio button for the MariaDB you wish to install and click the [Continue] button.
Step #5: Review Additional Warning Messages
Read over the warning messages on the Upgrade Warnings page so you can temper your expectations on what this change can potentially impact. You will need to select the checkmark next to each warning to confirm you have read and understand it. Once you are ready to procced, click the [Continue] button.
Step #6: Unattended vs. Interactive Upgrades
For ease of use and speed of execution, select the “Unattended Upgrade” option. This will take care of any dialogs during the installation process by automatically selecting the default options.
Note: There is usually no need for running the “Interactive Upgrade” option. It is most useful for troubleshooting when the unattended option has failed.
When ready to proceed click the [Continue] button once more
Step #7: Monitor The Upgrade Log
At this stage the unattended upgrade should have kicked off and you will see a log of events playing out in the browser scrollable text window. Simply observe and check back to make sure things are proceeding and the process has not failed.
Note: When using the Unattended Upgrade type, you do not need to stay on the page. Closing your tab or browser will not impact the upgrade process and it will continue to run to its natural conclusion.
Step #8: Finished – Wrapping Up
The Upgrade Process Succeeded
Your MySQL Server installation has been upgraded to MariaDB. Before we call the maintenance a success, you will need to perform the testing strategy that was prepared as part of the maintenance plan. This can be as simple as a list of links to check or as detailed as how to test specific edge-cases that may be of concern with a specific application.
Note: If you are using any third-party plugins or extensions that rely on MySQL, you may need to update them after the server upgrade. Check with those products documentation to make sure they support the version of MariaDB you have installed.
The Upgrade Process Failed
If you are unfortunate enough to encounter a failure during this process, the page will display the installation log where you can review what may have gone wrong during the process and work to correct it before attempting another upgrade.
Note: It is recommended to fallback to using the Interactive Upgrade option instead when troubleshooting a server that is failing its unattended upgrade process.
Jason Potter is a Senior Linux Systems Administrator & Technical Writer with more than 20 years experience providing technical support to customers and has a passion for writing competent and thorough technical documentation at all skill levels.
Abkrim says
This is not real, on cpanel 120 >
And I think that in the last 4 years, there was no longer the possibility of changing the engine,