Upgrade MariaDB 10.1 to 10.4 — CyberPanel - WebHosting Control Panel for OpenLiteSpeed
CyberLoader

Upgrade MariaDB 10.1 to 10.4

edited January 2020 in Database Server
Hi, Could someone please tell a short instruction on how to safely upgrade db from v10.1 to the latest v10.4 on CentOS 7.6. Preserving all the cyberpanel important configuration and relations to other modules.

Comments

  • edited March 2020
    @hennaboy said:

    > This is based on having ssh access and root if you dont try in the provided web terminal in Cyberpanel

    Hi. Is there a manual for ubuntu 18?
  • edited April 2020
    @hennaboy thank you for the Ubuntu commands above. I ran the commands to upgrade Mariadb 10.1 to 10.2 replacing '10.4' with '10.2 ' in the add-apt-repository command, the upgrade process completed but Mariadb version remained at 10.1. I think maybe I need to either remove or disable existing Mariadb repos.

    I tried running 'apt-key adv --fetch-keys ...' again and noticed the error 'Invalid Argument'. I tried another key repo and it gave the same error. I've searched the web but not found any solution. This is on a Ubuntu DO droplet. Also tried:

    wget -O http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xF1656F24C74CD1D8 | apt-key add -

    This said: g pg: no valid OpenPGP data found.
  • Following the instructions at https://mariadb.com/kb/en/installing-mariadb-deb-files/ for Ubuntu I used the following commands:

    curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
    apt-get install software-properties-common
    add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.2/ubuntu bionic main'
    service mysql stop
    cat /etc/cyberpanel/mysqlPassword
    apt remove mariadb-server mariadb-client
    apt update
    apt install mariadb-server mariadb-client
    service mysql start
    mysql_upgrade -uroot -p

    This worked except that despite specifying the 10.2 repo the process installed 10.4, maybe that was because I used 'apt update' before 'apt install'.
  • nano /etc/yum.repos.d/MariaDB.repo

    dont have it :(( centos
  • I successfully completed the process with the following codes (for centos7 and ceyberpanel v2.1)

    systemctl stop mariadb
    yum -y remove MariaDB-server MariaDB-client galera
    yum clean all

    yum -y install wget
    wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
    chmod +x mariadb_repo_setup
    sudo ./mariadb_repo_setup
    yum -y install MariaDB-server MariaDB-client galera

    systemctl enable mariadb
    systemctl start mariadb
  • > I tried running 'apt-key adv --fetch-keys ...' again and noticed the error 'Invalid Argument'. I tried another key repo and it gave the same error. I've searched the web but not found any solution. This is on a Ubuntu DO droplet. Also tried:

    Try this:

    wget https://mariadb.org/mariadb_release_signing_key.asc
    sudo apt-key add mariadb_release_signing_key.asc
  • Maria DB upgrade to 10.5 : https://mariadb.com/docs/deploy/upgrade-community-server-cs105-centos7/
  • edited September 2020
    Type your comment> @Aykut24 said:
    > nano /etc/yum.repos.d/MariaDB.repo
    >
    > dont have it :(( centos

    Don't have it either in CentOS 8.2 . Also just installed a fresh server of CentOS 8.2 with CyberPanel 2.0 build 3 and it finishes and uses MariaDB 10.3. I've tried to upgrade using the post at the top of the page from @hennaboy (which previously worked great) to MariaDB 10.4 and 10.5 with no success.

    The instructions from @usmannasir here https://cyberpanel.net/docs/upgrading-to-mariadb-10-5-manually/ don't work as well since /etc/yum.repos.d/mariadb.repo doesn't exist.
    You can upgrade manually but it breaks MariaDB when done.

    > @IsaiahAbe said:
    > Maria DB upgrade to 10.5 : https://mariadb.com/docs/deploy/upgrade-community-server-cs105-centos7/
    >
    This doesn't work either as: sudo yum remove "MariaDB-*" has no results.

    Wondering if adding this from @usmannasir https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/install/mysql/MariaDB.repo
    and editing centos 7 to 8 and 10.1 to 10.4 will do the trick and hit the repo. I'd be the guinea pig and test it, but can't do it on this server at the moment.

    Looking for help :)
  • @hennaboy Many thanks for the detailed upgrade description. May give it a shot this afternoon and will post back results. If anyone else attempts this, please post your findings.
    We're looking at building a new Magento 2.4 server which requires MariaDB 10.4 and had hoped that CyberPanel had installed and used 10.5 (or 10.4) on a fresh OS and panel install. Makes sense why @usmannasir opted to keep 10.3 as the stable.

    Wondering if simply removing 10.3, adding the repo file to etc/yum.repos.d and using @usmannasir 's instructions in the wiki would complete the process. Thinking out loud...
  • edited September 2020
    I noticed that Centos 7 now installs with mysql 10.5 out of the box.
  • @hennaboy Still a mess. The AppStream issue with CentOS 8 still persists with errors after install. Didn't get a chance to check to see if dovecot was working or not. There's got to be an easier way to install CyberPanel 2.0 build 3 with MariaDB 10.4...
  • After the reinstall you get a page of errors like this:

    Error: Transaction check error: https://pastebin.com/VjSpvCsX

    I didn't copy my errors from the terminal but replace 10.3.11 with 10.4.x -- different version of MariaDB but same errors.

    Even if we stay with MariaDB 10.3, this makes me question how we'll ever upgrade to 10.4 or 10.5 in the future. Also wondering why we're using gf.repo when in @usmannasir wiki, he clearly is using the mariadb repo as he mentions it at the beginning of the
  • Type your comment> @themew said:
    > After the reinstall you get a page of errors like this:
    >
    > Error: Transaction check error: https://pastebin.com/VjSpvCsX
    >
    > I didn't copy my errors from the terminal but replace 10.3.11 with 10.4.x -- different version of MariaDB but same errors.
    >
    > Even if we stay with MariaDB 10.3, this makes me question how we'll ever upgrade to 10.4 or 10.5 in the future. Also wondering why we're using gf.repo when in @usmannasir wiki, he clearly is using the mariadb repo as he mentions it at the beginning of the

    Its good that you are at 10.3, its the last version that is compatible with percona or mysql 8 incase you decide to migrate away in the future, if you upgrade to 10.4 it might make your database stuck with mariadb only.
  • Type your comment> @Numeriku said:

    > Its good that you are at 10.3, its the last version that is compatible with percona or mysql 8 incase you decide to migrate away in the future, if you upgrade to 10.4 it might make your database stuck with mariadb only.

    No question 10.3 is very stable and doesn't go eol until 2023, but Magento 2.4 requires 10.4 which is what we build with LiteSpeed and really want to continue using CyberPanel rather than another panel we've been using. Really don't want this issue to be a dealbreaker for us since we really like the CyberPanel/LiteSpeed combination.
  • Our old servers use Plesk, so I decided to try upgrading a CentOS 8 server from MariaDB 10.3 (stock install) to 10.4. Four ssh commands and it's upgraded. Still wondering why @usmannasir is using the gr.repo and not the MariaDB repos.

    Also wondering if by using your work around (which is very complete btw), we'll have issues upgrading CyberPanel to the next release with the gf.repo disabled and an os version of dovecot and postfix installed. Just trying to avoid downtime and headaches in the next few months :)
  • Type your comment> @NickW said:
    > Following the instructions at https://mariadb.com/kb/en/installing-mariadb-deb-files/ for Ubuntu I used the following commands:
    >
    > curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
    > apt-get install software-properties-common
    > add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.2/ubuntu bionic main'
    > service mysql stop
    > cat /etc/cyberpanel/mysqlPassword
    > apt remove mariadb-server mariadb-client
    > apt update
    > apt install mariadb-server mariadb-client
    > service mysql start
    > mysql_upgrade -uroot -p
    >
    > This worked except that despite specifying the 10.2 repo the process installed 10.4, maybe that was because I used 'apt update' before 'apt install'.

    Tried but last step

    @NickW
    Version check failed. Got the following error when calling the 'mysql' command line client
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
    FATAL ERROR: Upgrade failed
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!