centos 7 how do I safely upgrade from 5.5 mysql to 5.7 or mariadb newer?

Discussion in 'ISPConfig 3 Priority Support' started by craig baker, Sep 10, 2021.

  1. craig baker

    craig baker Member HowtoForge Supporter

    I'm trying to migrate from my centos 8 server to an older centos 7 server.
    migration fails because the key length in one of the mysql databases is too large for the older server mysql (5.5) to handle.
    (innodb had a key length limitation of 567 in older version).
    rather than try and fiddle the database keys, it might be easier to upgrade from 5.5 to 5.7 or newer mariadb that CAN handle the longer keys!
    how can this be done safely?
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Check out the how to upgrade MariaDB 5.5 version to 10.4 at: https://mariadb.com/resources/blog/installing-mariadb-10-on-centos-7-rhel-7/

    And please also read @florian030 post on how one should do it in comparison to the above: https://www.howtoforge.com/community/threads/mariadb-upgrade.87606/#post-427004

    Please backup and make sure your backup works.

    Thereafter upgrade MariaDB as prescribed above, if that works, update to Centos 8, follow its Perfect Server Tutorial and lastly force update ISPConfig configuring all services.
     
  3. craig baker

    craig baker Member HowtoForge Supporter

    ENLIGHTENMENT:

    problem was how to avoid the migration errors (due to target server having mysql 5.5 and innodb not handling keys >767 bytes that are created on source server running mariadb 10.3) - as it turns out suggestions like fixing the keys in the table were not useful as after all dont know how many tables would have been affected! or what else might be lost going from 4 bytes to 3 bytes. etc.
    So - question is how to upgrade from 5.5 on the target server!

    Most of the upgrade 5.5 pages have you UNINSTALL 5.5 first - hardly practical in a production server! (and it would remove postfix).
    I found the answer here:

    https://www.zerostopbits.com/how-to-upgrade-mariadb-5-5-to-mariadb-10-3-on-centos-7-5-1804/

    you do NOT have to remove the old maria (which also removes postfix due to postfix-mysql)!

    I got the 10.6 repo information from mariadb from this page
    https://downloads.mariadb.org/mariadb/repositories/

    and created the mariadb.repo for 10.6 stable.
    And then the yum upgrade picked up the newer components just fine!
    One note, after the upgrade you have to restart mysql and run:

    mysql_upgrade

    But you actually need:

    mysql_upgrade -u root -p

    to authenticate. upgrade worked just fine!
    And then migration tool worked just fine!

    Now I have to work out why postfix is saying postfix on target server not configures properly. but thats a different story!
     
  4. craig baker

    craig baker Member HowtoForge Supporter

    incoming mail problem - ran into this before - suddenly postgrey was not running
    nothing listening on 10023.
    - had to remember that on newer server I had to add in /etc/sysconfig/postgrey:
    POSTGREY_OPTS="--inet=10023"
    restart postgrey and all mail flowing!
     

Share This Page