Magento upgrade from 1.7 to 1.9

Upgrade Roadmap for CE 1.9.0.1 from 1.7

  1. Take a backup of current database and current 1.7 code. place maintenance.flag file inside 1.7 code folder to put website offline.
  2. Download latest magento from the http://www.magentocommerce.com/download
  3. Remove all folders and files from your 1.7 code except maintenance.flag (but you should have backup somewhere) and place all folders and files from the 1.9.
  4. Now from your 1.7 merge your following custom folders into the 1.9
    • Community app/code/community
    • Local app/code/local
    • Media
    • your theme or package (app/design/frontend/default/<your theme> or app/design/frontend/<your package>)
    • custom folders from Skin (both for adminhtml and frontend).
    • copy your custom xml files from app/etc/modules/ to current app/etc/modules/
    • any custom admin theme folder from adminhtml/default/yourtheme.
    • copy your custom folders from adminhtml/default/default/ (1.7) to adminhtml/default/default/ (1.9).
    • custom js files if any from app/js/.
  5. Now go to app/etc/local.xml.Edit database details their.put your database username and password and database name.
  6. Remove maintenance.flag file and check the site in the browser. it is done.

First of all, create the database same as current magento 1.7. Then download magento 1.9.0.1 from http://www.magentocommerce.com/download

Now run the installation of magento 1.9 and choose the database of your old website (magento 1.7.0.2)

Now you can take the your theme and skin from old version to new. Then after check one by one third party extension from old to new. I did it and it will work for for me.


Magento 1.x upgrade instruction using SSH or Command line:

1) Go to your Magento root directory

cd /path/to/your/magento/folder

2) Enable Maintenance mode for your Magento site

For this, you have to create an empty file named maintenance.flag in your Magento root directory.

touch maintenance.flag

3) Clear Cache & Sessions

rm -rf var/cache/* var/session/*

4) Check Compilation & Disable it if Enabled

Check Compiler Status

php -f shell/compiler.php -- state

If the Compiler Status is Disabled then you can skip this step and move on to the next step.

If the Compiler Status is Enabled then you have to disable it with the following command:

php -f shell/compiler.php -- disable

5) Give write permission to all Magento files and folders

chmod -R 777 .

6) Give 550 permission mage file

Mage file is a shell script file. With 550 permission, we are just making the file non-writable + readable & executable by user and group only.

chmod 550 ./mage

7) Change config settings to stable

./mage config-set preferred_state stable

8) Upgrade Magento

You can list all the installed packages with the following command:

./mage list-installed

You can list all the upgradable packages with the following command:

./mage list-upgrades

The following command will upgrade all the packages:

./mage upgrade-all --force

It will take some time to complete the upgrade.

9) Reindex Data

After completing the upgrade, we should reindex all data.

php shell/indexer.php reindexall

10) Then, clear cache and session again.

rm -rf var/cache/* var/session/*

11) Enable Compilation only if it was Enabled before upgrade

Check step 4) above.

If Compilation was not enabled in step 4) then you can skip this step and go to next step.

If Compilation was enabled for your website and you had disabled it at step 4) then you have to Enable it with the following command:

php -f shell/compiler.php -- enable

12) Change files permission

Before the upgrade, we have changed the permission of all files and folders to 777. You should also give proper permission to all files and folders of your Magento site.

Convert files permission to 644 and folders permission to 755

find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \;

Give read-write full permission, i.e. 777 to var and media folders.

chmod -R 777 var media

Give 550 permission to mage shell script file

chmod 550 ./mage

13) Check installed packages version

Check the versions of the installed packages. The packages should show the latest version as they are already upgraded now.

./mage list-installed

14) List upgradable packages

List the upgradable packages (packages that need an upgrade). This should result in a message saying No upgrades available because all packages have been already upgraded to the latest version.

./mage list-upgrades

15) Disable Maintenance mode to make the site Live

rm -f maintenance.flag

This will delete the file maintenance.flag and then the site will be live again.

You can now login to Magento admin and see the Magento version displayed in the footer section. It should show the latest version number.

Source: Magento 1.x – Update / Upgrade to Latest Version via both Browser & Command Line