If you ever have a need to migrate a website from one server to another, it can be a huge deal, especially when dealing with Magento, which has tens of thousands of files. Also, if your Magento store has many products, you have all those thousands of image files to move too. You could try FTP, but usually our servers hang during a large transfer. Even if you could do it by FTP, it would take hours at best to transfer a complete Magento site.
So here’s how to do a complete site migration using SSH. This can be used for any website you have root access to, not just a Magento site.
1. Login to server 1 via SSH and open the folder which you want to backup. You’ll probably need to login as root user.
Use this commands:
cd /home/somepath/to/yourwebsite/public_html
2. Make a compressed archive out of this folder using the command
Next:
tar -cvf sitepack.tar ./
3. Login to server 2 via SSH and use the command below to fetch the backup from server
wget yourdomain.com/sitepack.tar
4. Now uncompress the archive using the command
tar -xvf sitepack.tar
This is the easiest way we know of to move large websites with tons of files.
How to fix the error of maximum execution time exceeded or memory limit.
in your htaccess file put in this:
php_value memory_limit 256M
php_value max_execution_time 36000
You can even go up from there
If you get errors when using the Magento admin to do a backup of your database, we found this solution:
Open: /lib/Varien/Data/Collection/Filesystem.php
Find this line:
foreach (glob($folder . DIRECTORY_SEPARATOR . ‘*’) as $node) {
Change it to read:
foreach ((array)glob($folder . DIRECTORY_SEPARATOR . ‘*’) as $node) {
This cured our problem of getting error messages in Magento when trying to do a database backup with the Magento admin panel.
More and more now days, people shopping ecommerce sites are quite educated in regards to looking for a specific product and many times will know the part number or SKU they are looking for. We decided on our Magento stores to include the SKU# on the product listings on our category pages.
To see am example of showing product model numbers in a Magento commerce site, see here: Goodall StartAll’s
Here’s how we did it.
Open app/design/frontend/default/yourtheme/template/catalog/product/list.phtml
Determine where you want to add the SKU#. We added ours above the “Description” section of the product.
Paste in this code:
<div class=”product-name”>
<b> <a href=”<?php echo $_product->getProductUrl() ?>” title=”<?php echo $this->htmlEscape($_product->getName()) ?>”><?php echo nl2br($this->__($_product->getSku())) ?></a></b>
</div>
Save the file.
This should put the Sku# on your category page in the product listings. Better still from a search engine optimization stand point, the code supplied makes the Sku# appear in bold letters and it is a link to the product.