Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm currently trying to download a full magneto install from a ftp server. The connection keeps failing, it seems as if there are too many files and folders to scan through?

Can anyone shed any light on how to resolve this? The shared platform seems to b e a standard platform based on Plesk 8.6.

As this is a shared server, there is no option for me to really do anything, apart from contact the hosting company (who have offered to zip up all the files for me, but this is not ideal)

share|improve this question
add comment

3 Answers

Do you have SSH access? You can either do a recursive SCP or perhaps pipe a tar/gzip stream over the secure pipe. That way you'll avoid the FTP timeouts.

share|improve this answer
add comment

are you downloading the magento installation locally. Or is it for migrating the magento to a different server ?

share|improve this answer
add comment

If you've not got SSH access, then this should do you nicely,

From http://www.sonassi.com/knowledge-base/migrate-a-magento-store-without-ssh-access/

Simple create a PHP script on the origin server and destination server as per the below and replace the initial variables as necessary.

To Backup

<?php
        $db_host = "";
        $db_name = "";
        $db_username = "";
        $db_password = "";
        // Backup database
        shell_exec("/usr/bin/mysqldump -h ".$db_host." -u ".$db_username." -p".$db_password." > ".$db_name.".sql &");
        // Backup entire site
        shell_exec("/usr/bin/tar cfz ".$_SERVER['HTTP_HOST'].".tar.gz
            --exclude=./".$_SERVER['HTTP_HOST'].".tar.gz
            --exclude=./var/session".$_SERVER['HTTP_HOST']."
            --exclude=./var/cache".$_SERVER['HTTP_HOST']."
            ".$_SERVER['DOCUMENT_ROOT']." &");
    ?>

To Restore

<?php
    $db_host = "";
    $db_name = "";
    $db_username = "";
    $db_password = "";
    // Only set these if you are changing your domain name
    $old_domain = "";
    $new_domain = "";
    // Restore entire site
    shell_exec("/usr/bin/tar xfz ".$_SERVER['HTTP_HOST'].".tar.gz
        ".$_SERVER['DOCUMENT_ROOT']);
    if (!empty($old_domain) && !empty($new_domain)) {
        $sql = &file_get_contents($db_name.".sql");
        file_put_contents($db_name.".sql.bak",$sql);
        $sql = str_replace($old_domain,$new_domain,$sql)
        file_put_contents($db_name.".sql",$sql);
    }
    // Restore database
    shell_exec("/usr/bin/mysql -h ".$db_host." -u ".$db_username." -p".$db_password." < ".$db_name.".sql &");
    $xml = simplexml_load_file($_SERVER['DOCUMENT_ROOT']."app/etc/local.xml");
    $xml->global->resources->default_setup->connection->host = $db_host;
    $xml->global->resources->default_setup->connection->dbname = $db_name;
    $xml->global->resources->default_setup->connection->username = $db_username;
    $xml->global->resources->default_setup->connection->password = $db_password;
    $xml->asXML($_SERVER['DOCUMENT_ROOT']."app/etc/local.xml");
    // Disable cache
    @unlink($_SERVER['DOCUMENT_ROOT']."app/etc/use_cache.ser");
    @unlink($_SERVER['DOCUMENT_ROOT']."downloader/pear/pear.ini");
?>
share|improve this answer
    
Same again - links only answers are no good –  Iain Jun 22 '12 at 8:10
    
I'm on a mobile phone, so formatting full answers is a bit on the tricky side. I've done my best to include sufficient information above, ignoring the weak formatting. –  sonassi Jun 22 '12 at 8:20
    
:) backticks don't format well over multiple lines. –  Iain Jun 22 '12 at 8:25
    
I'm aware, but I'm on a mobile phone, reformat the post if its bothering you. –  sonassi Jun 22 '12 at 9:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.