In general, upgrading a production environment is not recommended and will stop LNMP related services after the upgrade begins.
This article applies only to LNMP1.2, 1.3 and 1.4 later versions!
In LNMP currently LNMP v1.2/1.3+ version has included Nginx, MYSQL/MARIADB, PHP, phpmyadmin upgrade script, can help build the environment of the program to upgrade. (Note: The following operations must be run in the directory after the LNMP installation package decompression Package)
One, nginx upgrade script
Execution:./upgrade.sh Nginx Enter the version number after prompting (visit http://nginx.org/en/download.html to find the latest version number and previous version number of Nginx. such as: 1.6.0), enter again confirm to start upgrading Nginx.If you want to upgrade to 1.9.5 or later you must use v1.3 or change the upgrade script inside the version。 Nginx upgrade to smooth upgrade, the upgrade process does not affect the operation of Nginx.
In addition, if you need to add additional modules can edit the lnmp.conf configuration file, in the quotation marks of the nginx_modules_options parameter add other required parameters (generally added third-party module is--add-module=/third-party module source directory).
LNMP version 1.2 modified include/upgrade_nginx.sh file
Add additional modules as needed in the double quotes of the nginx_modules_arguments= "" parameter, separate the module parameter spaces, and then run the upgrade.
Second, MySQL upgrade script
Although the script backs up the data, it is recommended that you back up yourself first!
Execution:./upgrade.sh MySQL needs to enter the MySQL root password for verification, verify that it will not be able to be upgraded, and verify that the version number of MySQL can be obtained by http://dev.mysql.com/downloads/mysql/ , enter to confirm, if you want to enable InnoDB, enter Y, not sure can also enter the input y enter the confirmation, again enter confirm to start the upgrade. The Mysql_upgrade date. log file is generated in the/root directory for troubleshooting when errors occur.
such as upgrade failure recovery: (1.4 and later) copy the Init.d.mysql.bak. Date file from the/usr/local/oldmysql date directory to the/etc/init.d/ Directory and rename it to MySQL and copy the My.cnf.bak. Date to the/etc/directory and rename it to my.cnf, and rename the/usr/local/oldmysql date directory to MySQL to restore MySQL. (MySQL upgrade to MARIADB and upgrade mariadb as below)
(versions 1.3 and below) Rename the My.conf.bak. Date configuration file under/etc/to Mysql.bak under MY.CNF and/etc/init.d/. Rename the date to MySQL, and/usr/local/ The Oldmysql date directory renamed to MySQL can be restored.
third, MySQL upgrade to mariadb script
MARIADB is a branch of MySQL that is maintained primarily by the open source community. MARIADB is compatible with MySQL, developed by MySQL founder. It is still recommended that you back up yourself first!
Execution:./upgrade.sh the need to enter the MySQL root password to verify, verify that the failure will not be able to upgrade, the verification can be passed to https://downloads.mariadb.org/to obtain the version number MARIADB, Enter after entering confirm, if you want to enable InnoDB, enter Y, not sure can also enter the input y enter the confirmation, again enter confirm to start the upgrade. The Mysql2mariadb_upgrade date will be produced in the/root directory. log file for troubleshooting when errors occur.
such as upgrade failure recovery: (1.4 and later) copy the Init.d.mysql2mariadb.bak. Date file from the/usr/local/mysql2mariadb date directory to the/etc/init.d/ Directory and rename it to MySQL and copy the My.cnf.mysql2mariadbbak. Date to the/etc/directory and rename it to My.cnf, and/usr/local/ The Mysql2mariadb date directory is renamed MySQL to restore MySQL.
(versions 1.3 and below) Rename the My.conf.bak. Date configuration file under/etc/to Mariadb.bak under MY.CNF and/etc/init.d/. Date is renamed to MARIADB, and/usr/local/ The oldmariadb date directory renamed to MARIADB can be restored.
iv. mariadb Upgrade Script
It is still recommended that you back up yourself first!
Execute:./upgrade.sh mariadb need to enter the MARIADB root password to verify, verify that the pass will not be able to upgrade, the verification can be passed to https://downloads.mariadb.org/to obtain MARIADB version number, Enter after entering confirm, if you want to enable InnoDB, enter Y, not sure can also enter the input y enter the confirmation, again enter confirm to start the upgrade. The Mariadb_upgrade date will be produced in the/root directory. log file for troubleshooting when errors occur.
such as upgrade failure recovery: (1.4 and later) copy the Init.d.mariadb.bak. Date file from the/usr/local/oldmariadb date directory to the/etc/init.d/ Directory and rename it to mariadb and copy the My.cnf.bak. Date to the/etc/directory and rename it to my.cnf, and rename the/usr/local/date directory under OLDMARIADB to mariadb to restore MARIADB.
(versions 1.3 and below) Rename the My.conf.bak. Date configuration file under/etc/to Mariadb.bak under MY.CNF and/etc/init.d/. Date is renamed to MARIADB, and/usr/local/ The oldmariadb date directory renamed to MARIADB can be restored.
v. LNMP PHP upgrade Script
Before upgrading PHP, please confirm that your website program supports the upgrade to PHP version, prevent the upgrade to the website program is not compatible with the PHP version, specific to the PHP program you use the official website to query the relevant version support information. v1.3 and later versions can also be degraded in most cases.
Execute:./upgrade.sh php to http://www.php.net/downloads.php get the version number, enter the version number, such as 5.3.28 enter, enter again to confirm to start the upgrade.
If you need to compile additional parameters, LNMP 1.3 and later versions can modify the quotation marks of the php_modules_options parameter in the lnmp.conf configuration file to add other required parameters.
LNMP version 1.2 modified include/upgrade_php.sh file
Add additional modules as needed in the double quotes of the php_modules_arguments= "" parameter, separate the module parameter spaces, and then run the upgrade.
After upgrading PHP if phpMyAdmin may not be available, you will need to upgrade phpMyAdmin to the phpMyAdmin version of PHP and MySQL.
If the upgrade fails, you can download and compress the/root/upgrade_lnmp_php date. Log log to Https://bbs.vpser.net forum for feedback.
If you want to restore the original PHP,/usr/local/the directory under oldphp log to PHP and,/usr/local/oldphp date/init.d.php-fpm.bak. Files copied to/etc/init.d/directory renamed to PHP-FPM can be restored.
vi. lnmpa/lamp php upgrade Script
Before upgrading PHP, please confirm that your website program supports the upgrade to PHP version, prevent the upgrade to the website program is not compatible with the PHP version, specific to the PHP program you use the official website to query the relevant version support information.
Execute:./upgrade.sh phpa to http://www.php.net/downloads.php get the version number, enter the version number, such as 5.3.28 carriage return, enter again to confirm to start the upgrade.
After upgrading PHP if phpMyAdmin may not be available, you will need to upgrade phpMyAdmin to the phpMyAdmin version of PHP and MySQL.
vii.. phpMyAdmin Upgrade Script
Pre-lifting grade recommended go to https://www.phpmyadmin.net/downloads/View phpMyAdmin version bugler confirm compatibility with PHP and MySQL.
Execute:./upgrade.sh phpMyAdmin Enter the phpMyAdmin version number, confirm the carriage return, and confirm the upgrade automatically.
LNMP 1.2/1.3+ upgrade Nginx, mysql/mariadb, PHP tutorials