How to Upgrade Magento from 1.7 to 1.9

How to Upgrade Magento from 1.7 to 1.9

Hey guys,

In this post I’ll show you how to upgrade you Magento web store from Magento 1.7 to Magento 1.9. The upgrade process involves upgrading the code base, data migration, migration of your existing Magento extensions & themes, and any custom code you may have implemented on your current site. Just follow the steps listed below to update your Magento installation from version 1.7 to 1.9.


Please keep in mind that you need to change the directory names in the last step of this tutorial in order to avoid any conflicts and to simplify and speed up the rollback strategy.


The directory name for the Magento 1.7 store used in this tutorial is store17. We will replace all occurrences of it with correct directory name, in the tutorial.

Upgrade Steps

1)    The first thing you need to do is disable the compilation and cache for your current web store. To do so, simply go to Disable Magento Compilation from System > Tools > Compilation > Disable in the Magento admin panel (as depicted below).

magento upgrade

2) Next, disable the Magento Cache from the System by navigating to Cache Management > Select All > Action: Disable > Submit (as depicted below).

upgrade magento

3) Turn on Maintenance Mode for the live store and make a backup of your database. Also make sure to extract the Magento 1.9 files for installation. Just follow the steps below to do all three of these activities.

	# Enable Maintenance Mode
	touch store17/maintenance.flag

	# Backup database for rollback
	mysqldump -u [db_user] -p [db_name] > store17_db_dump.sql

	# Copy and extract 1.9 tar file to web root
	tar -xzvf magento-
view hosted with ❤ by GitHub


4) Install Magento 1.9

Next we will install Magento 1.9. To do so you will need to install 1.9 in a separate directory but you’ll have to keep the database configuration the same. That means that when it the system prompts you to input the database information during the installation, you should provide the information of the same database being used by your live Magento 1.7 store.


For this tutorial, we’ll assume the directory name is ‘magento19’ for the Magento 1.9 installation.

5) Copy folders and files

You will need to copy a few mandatory folders and files from your Magento 1.7 store to this new installation. To do that just execute the following commands:


	yes | cp -R store17/app/code/community/* magento19/app/code/community/
	yes | cp -R store17/app/code/local/ magento19/app/code/local/
	yes | cp -R store17/media/* magento19/media/

	# if you have your own themes
	# Your Theme Folder: ROOT > app > design > frontend > default (package name) > “your_theme”
	mkdir app/design/frontend/default/your-theme/
	yes | cp -R store17/app/design/frontend/default/your-theme/* magento19/app/design/frontend/default/your-theme/

	yes | cp -R store17/skin/* magento19/skin/
	yes | cp -R store17/app/etc/modules/{custom.xml} magento19/app/etc/modules/
	yes | store17/app/design/adminhtml/default/* magento19/app/design/adminhtml/default/
	yes | store17/app/js/* magento19/js/*


6) Update the Base URL & Paths and Clear the Cache

To do that just execute the following commands.

mysql -u [db_user] -p [db_name]

UPDATE core_config_data SET value = '' WHERE path LIKE 'web/unsecure/base_url';
UPDATE core_config_data SET value = '' WHERE path LIKE 'web/secure/base_url';

# Backup store17 code and files and change magento19 installation to store17 path
mv store17 old17 && mv magento19 store17 && chown -R webserver-user:webserver-user store17

# Clear Cache
rm -Rf var/cache
rm -Rf var/session


7) Rollback

In case you want to roll back to your previous Magento 1.7 installation, just follow the steps below.

mysql -u {db_user} -p [db_name] < store17_db_dump.sql

# Update store17 to any name (e.g. magento) and restore old17 Backup to store17
mv store17 magento && mv old17 store17 && chown -R webserver-user:webserver-user store17

# Disable Maintenance Mode
rm store17/maintenance.flag

# Clear Cache
rm -Rf var/cache
rm -Rf var/session



This is the process you need to follow for upgrading to a standard installation of Magento 1.9 (from Magento 1.7). In my next post, I’ll show you how to how to find and add extensions to your newly upgraded Magento 1.9 web store.

Feel free to comment for any suggestions and additions to this tutorial.

If you have a Magento design, development or Magento customization requirement you would like to discuss (for Magento 1 or Magento 2) please get in touch with us. To learn more about our Magento development services, please visit


USA408 365 4638


1301 Shoreway Road, Suite 160,

Belmont, CA 94002

Contact us

Whether you are a large enterprise looking to augment your teams with experts resources or an SME looking to scale your business or a startup looking to build something.
We are your digital growth partner.

Tel: +1 408 365 4638
Support: +1 (408) 512 1812