This is done, the new default is 10.11.
@usmannasir
Sadly updating Cyber Panel from an older version to the latest still does not upgrade MariaDB
I am sorry, it won’t.
All the updates are not yet pushed to the new stable version.
How soon can we expect it on Stable? Mine is Ubuntu 20.04 with MaraDB 10.3 and I am getting warnings in WordPress websites.
3-4 weeks probably.
Why not deploy a new server first and before installing cyberpanel, just add the mariadb repo
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-10.11"
Then run the normal cyberpanel install script.
Then migrate your site to the new server however you like - manually, or a plugin like duplicator.
I only have one server and I have live websites on it. So I am kind of worried whether those website data will be effected if I upgrade by removing and adding the latest version. And I only upgraded the website from Centos 7 to Ubuntu 20.04, and I have done all the migration. So setting up the server again means lots of work. Is there anyway to make sure the data in the base will not get effected?
Thank you.
If you don’t have sys-admin experience I would still recommend setting up a new server and transfer.
Else do a backup of your mysql data and perform the upgrade.
Took A snapshot
Backed up all websites and downloaded them
Took mysqldump 2 times.
Then done this.
No need of the above 3. No need to restore the sql dump Tried restart and checked. This worked like a charm.
This should be like an official documentation.
Thank you.
Perhaps you guys could consolidate all of the useful information in this thread into the main post?
I already provided detailed steps that work well, and at least a couple people more or less duplicated that information in other comments…
@usmannasir
I have installed the new cyberpanel 2.3.5 update on Ubuntu 20.04lts and MariaDB remains obsolete
How to Upgrade MariaDB on Linux (AlmaLinux 8.8 and later)
Upgrade MariaDB on AlmaLinux
Step #1: Check the MariaDB and AlmaLinux Versions
You can check the current version of MariaDB and AlmaLinux by executing the following commands:
- ~]# mysql -V
- ~]# cat /etc/redhat-release
Here is the output:
[root@root ~]# mysql -V
mysql Ver 15.1 Distrib 10.5.21-MariaDB, for Linux (x86_64) using readline 5.1
[root@root ~]# cat /etc/redhat-release
AlmaLinux release 8.8 (Sapphire Caracal)
Step #2: Back Up the Database
Before performing a MariaDB upgrade, creating a backup or dump of the existing databases and database configuration file is essential.
To dump the database, use the following command:
- ~]# mysqldump --all-databases > /tmp/all-database-backup.sql
To copy the database directory into a different folder, use the following command:
- ~]# cp -a /var/lib/mysql /var/lib/mysql_oldbackup
To back up the configuration file, use the following command:
- ~]# cp -a /etc/my.cnf /etc/my.cnf_oldbackup
Note that the contents of /etc/my.cnf.d/ also need to be backed up if the file exists.
Step #3: Uninstall the Current MariaDB Repository
Before installing the newest version, uninstall the older MariaDB repositories. You can use the following command to stop the MariaDB service:
- ~]# systemctl stop mariadb
To confirm MariaDB’s current status, use the following command:
- ~]# systemctl status mariadb
To rename or move the current repo file, use the following command:
- ~]# mv /etc/yum.repos.d/mariadb.repo /etc/yum.repos.d/mariadb.repo_oldbackup
Step #4: Add the New MariaDB Repository (“Repo”)
Before creating a new MariaDB repository, you must update all the packages. You can use the following command to update all the packages:
- ~]# sudo dnf update -y
You can now create a new repo file for the latest MariaDB version:
- ~]# vi /etc/yum.repos.d/mariadb.repo
Then, add the following details to the /etc/yum.repos.d/mariadb.repo file and save the file:
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.11.6/rhel8-amd64
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
Step #5: Uninstall the Old MariaDB Version
You can uninstall the old version of MariaDB using the following command:
- ~]# sudo dnf remove MariaDB-server -y
To clean the repository cache on your server, use the following command:
- ~]# sudo dnf clean all
Step #6: Install the Latest MariaDB Version
Now, you are ready to upgrade MariaDB. To install the latest MariaDB version, use the following command:
- ~]# sudo dnf install MariaDB-server -y
Here is the output:
Output
[root@root ~]# sudo dnf install MariaDB-server -y
AlmaLinux 8 - BaseOS 6.0 MB/s | 4.0 MB 00:00
AlmaLinux 8 - AppStream 16 MB/s | 11 MB 00:00
AlmaLinux 8 - Extras 32 kB/s | 18 kB 00:00
MariaDB 1.0 MB/s | 620 kB 00:00
Dependencies resolved.
=========================================================================================================================================================================
Package Architecture Version Repository Size
=========================================================================================================================================================================
Installing:
MariaDB-server x86_64 10.10.5-1.el8 mariadb 27 M
—-
—-
Installed:
MariaDB-server-10.10.5-1.el8.x86_64 boost-program-options-1.66.0-13.el8.x86_64 galera-4-26.4.14-1.el8.x86_64 libpmem-1.6.1-1.el8.x86_64 lsof-4.93.2-1.el8.x86_64
socat-1.7.4.1-1.el8.x86_64
Complete!
To install the most common MariaDB packages, as part of the overall MariaDB upgrade, use the following command:
- ~]# sudo dnf install galera-4 MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common -y
Step #7: Start MariaDB
To start the MariaDB service, use the following command:
- ~]# sudo systemctl start mariadb
Step #8: Set MariaDB to Start at Boot-Time
To set MariaDB to start at boot time, use the following command:
- ~]# sudo systemctl enable mariadb
Here is the output:
[root@root ~]# sudo systemctl enable mariadb
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
Step #9: Upgrade MariaDB
To upgrade MariaDB, use the following command:
- ~]# mysql_upgrade
Here is the output:
Output
[root@root ~]# mysql_upgrade
Major version upgrade detected from 10.5.21-MariaDB to 10.10.5-MariaDB. Check required!
Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
mysql.servers OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.transaction_registry OK
mysql.user OK
Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views
Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
performance_schema
Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
Step #10: Check the Current MariaDB Version
Use the following command to check and verify the currently installed MariaDB version:
- ~]# mysql -V
Here is the output:
[root@root ~]# mysql -V
mysql Ver 15.1 Distrib 10.10.5-MariaDB, for Linux (x86_64) using readline 5.1
[root@root ~]#
Congratulations on completing a successful MariaDB upgrade!
Secure the MariaDB Database
The most recent version of MariaDB has been set up on AlmaLinux 8. You can now secure the MariaDB Database by using the following command:
- ~]# sudo mysql_secure_installation
Here is the output:
Output
[root@root ~]# sudo mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
To log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, I successfully used the password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorization.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing and should be removed
before moving into a production environment.
Remove the test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
So what’s the latest advice to upgrade MariaDB on Ubuntu? Will Cyberpanel do this automatically?