Learn about Centmin Mod LEMP Stack today
Become a Member

Upgrade How to upgrade Centmin Mod + backing up customisations

Discussion in 'Centmin Mod Insights' started by eva2000, Jul 20, 2016.

  1. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    2:23 AM
    Nginx 1.13.x
    MariaDB 5.5
    Centmin Mod code upgrades via centmin.sh menu option 23 don't really make changes to other files needlessly. However, you really need to try and keep the code/routines that Centmin Mod uses up to date.

    You can try the following by backing up the main files first and then do a fresh Centmin Mod code replacement by backing up and moving /usr/local/src/centminmod.

    Replace branchname variable below with branch you want either 123.08stable or 123.09beta01 and type in SSH window the following:.
    Code (Text):
    branchname=123.09beta01
    

    The cp copy commands backup the key files/vhost/ssl etc first. Remember to replace branchname with branch you want either 123.08stable or 123.09beta01
    Code (Text):
    branchname=123.09beta01
    cp -a /etc/my.cnf /etc/my.cnf-old
    cp -a /usr/local/etc/php-fpm.conf /usr/local/etc/php-fpm.conf-old
    cp -a /etc/centminmod /etc/centminmod-old
    cp -a /usr/local/nginx/conf /usr/local/nginx/conf-old
    cd /usr/local/src
    mv centminmod centminmod-old
    git clone -b ${branchname} --depth=1 https://github.com/centminmod/centminmod.git centminmod
    cd centminmod
    ./centmin.sh

    the last run for centmin.sh syncs any needed changes

    then you can compare all the new and old directory and files and transfer them back manually if needed
    Code (Text):
    sdiff /etc/my.cnf /etc/my.cnf-old
    sdiff /usr/local/etc/php-fpm.conf /usr/local/etc/php-fpm.conf-old
    diff -qr /etc/centminmod /etc/centminmod-old
    diff -qr /usr/local/nginx/conf /usr/local/nginx/conf-old
    diff -qr /usr/local/src/centminmod /usr/local/src/centminmod-old
    

    example if file differs
    Code (Text):
    diff -qr /etc/centminmod /etc/centminmod-old
    Files /etc/centminmod/email-primary.ini and /etc/centminmod-old/email-primary.ini differ

    then use sdiff to see what the actual difference is

    sdiff side by side view
    Code (Text):
    sdiff /etc/centminmod/email-primary.ini /etc/centminmod-old/email-primary.ini

    sdiff side by side view only differences flag -s
    Code (Text):
    sdiff -s /etc/centminmod/email-primary.ini /etc/centminmod-old/email-primary.ini

    Code (Text):
    sdiff /etc/centminmod/email-primary.ini /etc/centminmod-old/email-primary.ini
    3 | 1


    These steps ensure you're running the latest routines that power Centmin Mod.

    Folks, can post the output of the diff -qr commands and I will tell whether or not there's a better way to ensure some changes persist after Centminn Mod updates i.e. if you can use persistent config file method via /etc/centminmod/custom_config.inc etc

    There's also a list of other file comparison tools you can use within SSH or locally on own PC listed at List of file comparison tools | Centmin Mod Community For windows I use BeyondCompare
     
    Last edited: Nov 11, 2016
    • Informative Informative x 2
  2. ethanpil

    ethanpil Active Member

    168
    47
    28
    Nov 8, 2015
    Ratings:
    +87
    Local Time:
    2:23 AM
    I am thinking that this entire process can be automated with a simple script?
     
  3. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    2:23 AM
    Nginx 1.13.x
    MariaDB 5.5
    yeah it could if you want to whip up a script yourself

    but you can't do the file/settings diff compare in automated fashion, you'd need your own pair of eyes to determine which changes you'd want to keep or discard
     
  4. ethanpil

    ethanpil Active Member

    168
    47
    28
    Nov 8, 2015
    Ratings:
    +87
    Local Time:
    2:23 AM
    Agreed about the final changes, but it would be simple to create the report in a file so that upgrades are easier.
     
  5. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    2:23 AM
    Nginx 1.13.x
    MariaDB 5.5
    Yeah I suppose. But good manual practice first is always good for beginners :) ;)