9854-888-021 New York, NY
Posted on / by admin / in featured, Latest News, Linux, PHP, Software

Moving Magento site from development server to live server

Recently I faced problem to move magento site from local (LAMP) environment to web server. I am posting steps to upload site on server.

1. Make tar / zip of code.

$ tar -cvvf site.tar /opt/lampp/magento/

2. Take backup of database through phpmyadmin. Check “Disable foreign key checks” to avoid error in restore process.

3. Open backup sql file and add following

In beginning

SET @[email protected]@CHARACTER_SET_CLIENT;
SET @[email protected]@CHARACTER_SET_RESULTS;
SET @[email protected]@COLLATION_CONNECTION;
SET @[email protected]@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @[email protected]@SQL_NOTES, SQL_NOTES=0;

and following in the end of file

SET [email protected]_SQL_MODE;
SET [email protected]_FOREIGN_KEY_CHECKS;
SET [email protected]_UNIQUE_CHECKS;
SET [email protected]_CHARACTER_SET_CLIENT;
SET [email protected]_CHARACTER_SET_RESULTS;
SET [email protected]_SQL_NOTES;

4. Upload tar / zip file on web server, extract and deploy. Don’t forget to clear cache (Clear /var/cache and /var/session directories).

tar -xvvf site.tar

5. Change /var permission to 777 recursively.

$ chmod 777 /home/magento/htdocs/var

6. Restore database on server through phpmyadmin.

7. Change mysql database setting in



8. Run website.

If you are getting blank page then check the following

1. Mysql Database setting.

2. Did you clear cache?

3. Followed step3?

If you are getting Undefined index 0 Error then check the following

1. Did you followed step3?

2. Or you can manually run these queries

UPDATE `magento`.`core_website` SET `website_id` = ‘0’ WHERE `core_website`.`code` = ‘admin’  LIMIT 1 ;

UPDATE `magento`.`core_store` SET `store_id` = ‘0’ WHERE `core_store`.`code` = ‘admin’ LIMIT 1 ;

Clear cache as you make any change.


Leave a Reply