Friday, 18 September 2009

Transfer a Magento website using ssh

BEFORE YOU START BACKUP EVERYTHING - for commands on doing that you can check this blog Transferring a Website using SSH

> first of all we need to zip the website

tar -czvf fileName.tar.gz folderName/

Secondly backup your mysql. The easiest way to do this is to use the 'Export' feature in myMysqlAdmin

> next ssh into the website that your transferring to.

>if you need to delete a folder here you can use
rm -r public_html/

> now its time to go and get the zip file


!note - you may need to move this file to somewhere you can see it if it's in a directory deeper that public_html/

> to unzip the file

tar -zxvf fileName.tar.gz

> make a mysql backup
mysqldump -h hostname -u dbUsername -p dbName > db_backup.sql

note! like myself you may prefer to use phpMyAdmin

> set permissions -
either by using ssh. - first of all be in the public_html/ folder

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

or use this file chmod.php to sort my chmod settings.
You can fin this here ->

> Open the file local.xml under the "/home/username/public_html/magento_dir/app/etc/" directory in your text editor. Locate the and make the necessary changes.
< default_setup >
< connection >
< host >< ![CDATA[localhost]] >< /host >
< username >< ![CDATA[dbUsername]] >< /username >
< password >< ![CDATA[dbPassword]] >< /password >
< dbname >< ![CDATA[dbName]] >< /dbname >
< active >1< /active >
< /connection >
< /default_setup >

> empty the cache under var/cache

1 comment:

sukumar said...

nice information about magento I got new message about magento. I will tell who want inform about megento. Magento eCommerce Development