我目前正在尝试从 ftp 服务器下载完整的 magneto 安装。连接一直失败,好像有太多文件和文件夹需要扫描?
有人能解释一下如何解决这个问题吗?共享平台似乎是基于 Plesk 8.6 的标准平台。
由于这是共享服务器,我除了联系托管公司(他们愿意帮我压缩所有文件,但这并不理想)之外,没有其他选择。
答案1
您有 SSH 访问权限吗?您可以执行递归 SCP,或者通过安全管道传输 tar/gzip 流。这样您就可以避免 FTP 超时。
答案2
如果你没有 SSH 访问权限,那么这个应该对你有用,
从http://www.sonassi.com/knowledge-base/migrate-a-magento-store-without-ssh-access/
只需按照以下步骤在源服务器和目标服务器上创建一个 PHP 脚本,并根据需要替换初始变量。
备份
<?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']." &");
?>
恢复
<?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");
?>