LinkedIn Twitter RSS Reset

Moving Magento Shop from Development Enviornment to Production Enviornment or Production to Local

Today, I had really a good chance to move Magento Shop from Development Enviournment to Product Enviornment. On that course I faced some big difficulty in moving the database. I already had the files and DB of the development enviornment, imporing DB was a PIA. I uploaded all the files, which was easy. And next thing I did was uploaded DB dumpped files to root of Magento. Then I logged into SSH and logged into MYSQL. Then Used the following commands to import the dumpped DB files. But first made the database say “magento”.

/**Using the Previously created DB**/
mysql> use magento

/**Import the Dumpped SQL**/
mysql>source pathToMagentoRoot/mySql.sql

So after the command is executed I had the whole DB on production enviornment. Similarly we can also import dumpped data of Production on Local database running on WAMP server.
To import Dumpped SQL data on WAMP, first create a database, say magento and then use the following commands

/**
	Using the Previously created DB.
	-p password part is optional if you have not configured password for MYSQL locally
	-u Username (root by default)
**/

mysql> C:\wamp\bin\mysql\mysql5.0.51b\bin>mysql.exe -use magento -u root -p password

/**Import the Dumpped SQL**/
mysql>source pathToSQLSource/mySql.sql

By Now we have the database synced between Local and Production. Next is configuring the database name used by Magento. Browse to app/etc/local.xml and change in the following part.

    <connection>
                    <host><![CDATA[localhost]]></host>
                    <username><![CDATA[username_here]]></username>
                    <password><![CDATA[password_here]]></password>
                    <dbname><![CDATA[databasename_here]]></dbname>
                    <active>1</active>
    </connection>

Finally, browsed through table core_config_data and find value of path: web/unsecure/base_url and path: web/secure/base_url and change their values accordingly.

Now I had my Shop enviorment switched. Most work for you as well. LOL.

5 Responses to “Moving Magento Shop from Development Enviornment to Production Enviornment or Production to Local”

  1. Zake
    January 12, 2010 at 10:22 am #

    Nice tips

    • Subesh Pokhrel
      January 12, 2010 at 4:11 pm #

      Thanks!

  2. ana hare
    February 22, 2010 at 10:53 am #

    Thank you for all your posts.. you are a total hero… now I just have to try them all out. x

    • Subesh Pokhrel
      February 22, 2010 at 12:19 pm #

      Thanks for the Complement..!

  3. mtavern
    June 24, 2010 at 1:37 pm #

    Nice blog.How do you do it when you already have the customer data in the production and just want to synchronize the added features..especially product categories and cms pages from dev to production…thanks..i will be glad if you can reply me

Leave a Comment