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)

2 Answers 2

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.

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");
?>
4
  • Same again - links only answers are no good
    – user9517
    Jun 22, 2012 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. Jun 22, 2012 at 8:20
  • :) backticks don't format well over multiple lines.
    – user9517
    Jun 22, 2012 at 8:25
  • I'm aware, but I'm on a mobile phone, reformat the post if its bothering you. Jun 22, 2012 at 9:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .