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.
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:
- SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
- SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;
- SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;
- SET NAMES utf8;
- SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
- SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
- SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=‘NO_AUTO_VALUE_ON_ZERO’;
- SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0;
Place below lines of MYSQL code on very end of the .SQL file:
- SET SQL_MODE=@OLD_SQL_MODE;
- SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
- SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
- SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT;
- SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS;
- SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION;
- 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!