Learn about Centmin Mod LEMP Stack today
Become a Member

Sysadmin Best way to backup before doing software upgrades?

Discussion in 'System Administration' started by deltahf, Apr 27, 2020.

  1. deltahf

    deltahf Premium Member Premium Member

    Jun 8, 2014
    Local Time:
    5:58 AM
    I've always been curious what the best practice is to back up before updating software like Nginx or PHP.

    I have daily disk-image backups of my server and obviously I can rsync important folders and backup databases, but what should I do before updating something like PHP or Nginx? If things don't work after the upgrade, what is the most reliable way to quickly get things working again (without restoring the whole disk image)? How do you guys mitigate this particular risk?
  2. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    7:58 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Sticky thread in Centmin Mod Insights forum might help Upgrade - Nginx - Insight Guide - How to upgrade Centmin Mod + backing up customisations

    But nginx and php upgrades don't really need backing up, as if the version you upgrade to don't work, you just downgrade the versions.

    If you're in a pinch, you could backup the nginx binary itself via tools/nginx-binary-backup.sh tool script in 123.09beta01 and newer Beta Branch - Nginx binary + modules backup/restore - nginx-binary-backup.sh

    Also working on PHP-FPM binary backup tool tools/php-binary-backup.sh too PHP-FPM - Beta Branch - PHP binary + extensions backup/restore tool - php-binary-backup.sh but that one isn't public available yet.

    Nginx and PHP-FPM binary backup and restore tools, allow you to quickly backup and revert versions without going through the full compilation routine. Ideal if you are testing different PHP or Nginx version configurations.

    Last edited: Apr 27, 2020