Moving Magento site from development to live server

June 23rd, 2012 by Laeeq | 2 comments

It’s very time consuming task to move Magento project from development to live server. Actually there is few error creatd with Magento project, when we move same development server’s fils to live server. sometimes we have to make a new magento install and then move templates and skins/media files. This procees consume a lots of developer time becuase files upload time get doubled.

Here in this post I have find a very short and complete solution for moving development server’s Magento project files to live server without making any fresh Magento install.

magento move to online server

Import Development Mysql database to Live Server

First, make a backup of entire Magento database with all the default phpMyAdmin options. Backup your database to .sql file.

Let’s suppose your development site is located at http://developmentsite.com and your live site is located at http://livesite.com.

The second step for you to open the .SQL backup file and search/ReplaceAll from “developmentsite” to “livesite”. this is must before importing database. Actaully Magento stores complete url paths inside the database.

After making above changes to .SQL file, Do few more changes to your .SQL file before importing. these changes will fix the issue of MySQL foreign key constraint.

So open your .SQL file and do the following changes.

Place below lines of MYSQL code on very top of the .sql file:

  1. SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
  2. SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;
  3. SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;
  4. SET NAMES utf8;
  5. SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
  6. SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
  7. SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=‘NO_AUTO_VALUE_ON_ZERO’;
  8. SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0;

Place below lines of MYSQL code on very end of the .SQL file:

  1. SET SQL_MODE=@OLD_SQL_MODE;
  2. SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
  3. SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
  4. SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT;
  5. SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS;
  6. SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION;
  7. SET SQL_NOTES=@OLD_SQL_NOTES;

Now you’re ready to import your .sql file to live MySQL database.

Move Project files to Live Server

Now copied entire project files of your Magento project from development server to Live Server. Modify the database connection information file with new databse at app/etc/local.xml. Also check the folders write permissions, specially folders like /app, /app/etc, /var, /var/log, /var/session and so on. provide them appropriate access rights (755, 775, 777). Now your are ready to run your project on live server.

Hope it will work for you!

You can subscribe to PHPZAG.COM posts by Email

 

Related Topics:

  • Tips To Improve Your Ecommerce Site’s Security
  •  

     

    1. tobykingkp
      October 3rd, 2012 at 14:30 | #1

      Somebody necessarily lend a hand to make significantly posts I would state. That is the first time I frequented your website page and thus far? I surprised with the analysis you made to make this actual put up amazing. Fantastic activity!

    2. January 9th, 2013 at 10:52 | #2

      Great and clear instructions. Its a Except I get errors on the MySQL codes that I have to add to my .sql file.

    1. No trackbacks yet.