Thursday, 07 August 2014 11:12

Magento - Transfer to test server

On the live server create a file backup and a database backup ( check your disk space first as Magento installations can be large )

Example with SSH

mysqldump -u DBUSER -p DBNAME > FILENAME.sql # Create a sql backup. You can do this via phpadmin if required

tar -czif ARCHIVENAME.tar.gz

Transfer files to your new environment using ftp and place in the root of your new site. Then after creating a duplicate named database, user and password ( you do not have to do this but it makes one step easier ) Restore the two backups

tar -zxvf ARCHIVENAME.tar.gz

mysql -h HOST -u USER -p DATABASENAME < FILENAME.sql

Now modify the local settings firstly in /app/etc/local/xml where you are looking for the block below. Change HOSTNAME, USERNAME, PASSWORD,DATABASENAME to match thos that you have created.

 

<connection>
                    <host><![CDATA[HOSTNAME]]></host>
                    <username><![CDATA[USERNAME]]></username>
                    <password><![CDATA[PASSWORD]]></password>
                    <dbname><![CDATA[DATABASENAME]]></dbname> 

Then modfy the table core_config_data, chanmging the records for web/secure/base_url and web/unsecure/base_url to match you servers domain name

After that delete the cache from the root of the new server by 

rm -rf var/cache/* var/session/*

And reindex the tables with 

php shell/indexer.php reindexall

 

 

Read 1659 times Last modified on Saturday, 09 August 2014 11:48