Magento 1 || How to upgrade version - mpaz-redstage/magento-snippets GitHub Wiki

Download the magento folder

https://codeload.github.com/OpenMage/magento-mirror/tar.gz/1.9.2.0

For this step you need to check the path to your store.
My example: /var/www/vhosts/store.com
Open the folder /var/www/vhosts:

cd /var/www/vhosts  

Now that we are going to save the entire store.com folder:

tar -cvf backup_store.tar store.com  

Now we have the backup of the files, we need to make a backup of the database. You need to know the name of the database you use, for our example will be: store_magento. Run the following command (you will need to enter the password):

mysqldump -u root -p store_magento > store_magentosql

Now that we have the backup we will update Magento. First open the folder where Magento is.

cd /var/www/vhosts/store.com   

Our second step is to download Magento 1.9:

wget http://www.magentocommerce.com/downloads/assets/1.9.0.1/magento-1.9.0.1.tar.gz
tar xvf magento-1.9.0.1.tar.gz

Let's open the .htaccess file and change the maximum memory it can use and the maximum execution time of PHP. Be very careful with numbers, decrease or increase if necessary.

php_value memory_limit 2048M
php_value max_execution_time 90000

Now let's clear all caches and update apache / nginx. If you use Ubuntu / Debian use apache2, in the example we use CentOS / RHEL. If you have Varnish add another line with Varnish.

rm -rf var/cache/* var/session/* var/locks/* var/full_page_cache/* tmp/*
rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
service httpd restart

Let's now remove the downloader and app/design/frontend/base folder. We will remove these files so that you have no problems with files that have changed. Run the command:

rm -rf downloader
rm -rf app/design/frontend/base

Our next step is to copy the folders we removed directly from the new version, run the command:

cp -a magento/downloader .
cp -a magento/app/design/frontend/base/ app/design/frontend/

Let's also use the mage file of the new version. Execute:

cp magento/mage .
chmod 755 ./mage

Before doing the upgrade we need to make sure that Connect is set to Stable. Run the command:

./mage config-set preferred_state stable

Now let's copy all the new Magento files. To make sure all files have been copied, let's run the same command 3 times. Run the following command:

for i in {1..3}; do yes | cp -Rf magento/* .; done

https://magentobr.com/upgrade-magento-1.9