0

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)

optician
  • 533
  • 8
  • 19

2 Answers2

0

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.

McJeff
  • 2,039
  • 13
  • 11
0

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");
?>
user9517
  • 115,471
  • 20
  • 215
  • 297
Ben Lessani
  • 5,244
  • 17
  • 37