Learn about Centmin Mod LEMP Stack today
Register Now

Upgrade advice for upgrading centminmod?

Discussion in 'Install & Upgrades or Pre-Install Questions' started by moshbit, Jul 22, 2016.

  1. moshbit

    moshbit Member

    41
    10
    8
    Jun 15, 2014
    Ratings:
    +10
    Local Time:
    6:09 AM
    1.5.8
    MariaDB 5.5
    Hey folks, I've been using centminmod for quite a while now, but I haven't upgraded in entirely too long (I was still learning and afraid I would break things) so now i'm stuck on 1.2.3-eva2000.04 (i think) and I'd like to update to the latest version. I've been reading around and it seems to get github and all that goodness with auto updates working it's best to just backup everything and do a clean install. is this correct?

    also, what settings should i backup? i'm thinking my website files/database (obviously), my vhost configs, my ssl configs and certs.... is there anything i'm missing?

    also, can i just copy my ssl keys/crt from the old server to the new one, or is that tied to the server somehow (maybe when it was generated)?

    thanks for all the help, centminmod is a friggin lifesaver :)
     
  2. eva2000

    eva2000 Administrator Staff Member

    28,972
    6,575
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,759
    Local Time:
    11:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    you can as they're not tied to your server if you used paid ssl certificates.

    Upgrades don't really make changes to other files needlessly. 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 with branch you want either 123.08stable or 123.09beta01. The cp copy commands backup the key files/vhost/ssl etc first
    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.

    If you can post the output of the diff -qr commands, I can 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
     
    • Useful Useful x 1
  3. moshbit

    moshbit Member

    41
    10
    8
    Jun 15, 2014
    Ratings:
    +10
    Local Time:
    6:09 AM
    1.5.8
    MariaDB 5.5
    wow, that's a lot of info, thanks! i'll take a minute to pour through that.

    this is for a personal website of mine that i don't mind having downtime on, so wouldn't it be easier/more reliable to back it up, wipe it out, reinstall/upgrade and restore backup (and edit vhosts, etc)? or is what i'm planning just total overkill?
     
  4. eva2000

    eva2000 Administrator Staff Member

    28,972
    6,575
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,759
    Local Time:
    11:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    Upgrading Centmin Mod involves 2 parts.
    1. Upgrading the actual Centmin Mod code outlined at Upgrade Centmin Mod. This is heart of Centmin Mod where the code is the engine that runs centmin.sh shell based menu and all the automation you're accustomed to. You can easily update within a Centmin Mod version branch or switch version branches via centmin.sh menu option 23 outlined here.
    2. Upgrade software that Centmin Mod installed or manages. For this part following outline at How to upgrade Centmin Mod software installed on your server.
    So essentially, you can upgrade from .07 to .08 in place, but not everything is upgraded as some things like server initial environment setup isn't changed i.e. how swap, tmp setup and allocation are created etc. The main parts from part 2 above are what in place upgrades do i.e. Nginx and PHP-FPM compilation and config/settings parameters and MariaDB version from 5.5 to 10.0.x. If you want the full environment changed including tmp and swap setup to .08's configuration, then you would need a fresh OS install and fresh .08 initial install. You can think of it like upgrading Windows 7 to Windows 8. An in place upgrade will upgrade code but won't change your computer environment from when you installed Windows 7 i.e. disk configuration and partition sizes won't change from when you initially installed Windows 7. Only way to change that would be fresh Windows 8 install.

    So if you want full 123.08stable or my preferred 123.09beta01 experience (change log), a fresh install on new vps and data transfer might be more idea. Once on 123.08stable, updates get easier due to centmin.sh menu option 23. Getting Started Guide step 19 outlines also how to keep Centmin Mod code updated or how to switch version branches.

    With Centmin Mod 1.2.3-eva2000.08) (123.08stable) and higher releases, a newly added centmin.sh menu option 23 allows much easier code updates and version branch swicthing via Git backed environment you can setup. For full details read the following links:
     
    • Useful Useful x 1
  5. moshbit

    moshbit Member

    41
    10
    8
    Jun 15, 2014
    Ratings:
    +10
    Local Time:
    6:09 AM
    1.5.8
    MariaDB 5.5
    okay, yeah, that's what i thought i remembered reading. i'll do the fresh OS install and let you know how it goes :)
     
  6. moshbit

    moshbit Member

    41
    10
    8
    Jun 15, 2014
    Ratings:
    +10
    Local Time:
    6:09 AM
    1.5.8
    MariaDB 5.5
    so i did it and the whole process took about 8 hours, most of which was just me downloading and re-uploading all the website files. ran into a few small hurdles that were mostly my own mistakes, but nothing that i didn't overcome with a little bit of reading. overall it went quite well for only my 4th or 5th fresh install (of centminmod) ever.

    not sure if i should create another thread for this, but i noticed my nginx user is set to no login on the shell. what would be the best way to set up ssh (non-root) access? set up another user? or just change the nologin option on the nginx user? thanks!
     
  7. eva2000

    eva2000 Administrator Staff Member

    28,972
    6,575
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,759
    Local Time:
    11:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    nice

    no leave nologin set for nginx user

    see FAQ item 2, Getting Started Guide step 2's mention of uploading files and Pureftp virtual ftp user for for older users see thread 1st post on how to setup Pureftp user on old installs at Beta Branch - Centmin Mod .08 beta + pure-ftpd virtual FTP user support | Centmin Mod Community
    but if you did fresh install and new centmin.sh menu option 2 setup for site vhost, you would of generated the pure-ftpd virtual ftp user for uploading files too
     
    • Useful Useful x 1
  8. moshbit

    moshbit Member

    41
    10
    8
    Jun 15, 2014
    Ratings:
    +10
    Local Time:
    6:09 AM
    1.5.8
    MariaDB 5.5
    ah, i see, okay, sweet :)

    it seems a lot of server tutorials encourage locking out the root account's ssh access, but if you say to just use the root and sftp accounts for maintenance (as stated in faq item #2), i'll just do it that way.

    and yes, since it's a fresh install i have the sftp user account info, so i'll just use that for uploading website files and root for maintenance.

    things are looking great, i appreciate the help!
     
    • Like Like x 1
  9. eva2000

    eva2000 Administrator Staff Member

    28,972
    6,575
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,759
    Local Time:
    11:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    yeah i touched on security and ssh keys in reply to @hitman's thread at protect root user over ssh | Centmin Mod Community and similarly applies to using root user i.e. using console in DigitalOcean if you loose access to your server via SSH

     
    Last edited: Aug 5, 2016