How to backup magento to another installation

Jul 15, 2013, by admin

Using SSH you can take the following steps to backup and move Magento to a new Site make sure you are at the root of the magento when you run the followin commands

Backup the MySQL Database

mysqldump -h DBHOST -u DBUSER -pDBPASS DBNAME > data.sql

        DBHOST – Database host name, usually just localhost
        DBUSER – Database user with access rights to the database
        DBPASS – The password for the database user
        DBNAME – The name of the database that Magento is using

Backup the media directory with all product pics

tar -cvf media.tar media/*

Backup the app directory for the default interface

cd app/design/frontend/default/

        tar -cvf app.tar mytheme/

Change mytheme with the name of your theme

Backup the skin directory for the default interface

cd skin/frontend/default/

        tar -cvf skin.tar mytheme/

Change mytheme with the name of your theme

Backup the config file localed here:

app/etc/local.xml

Extract and overwrite all the files saved above to your new location

To import the database use phpmyadmin or use this command line :

  mysql -h DBHOST -u DBUSER -pDBPASS DBNAME < data.sql