在遷移安裝了web應用程式的網站時,必須在目標伺服器上調整應用程式才能正常運行。您可以手動調整它們,或者讓 PleskMigrator 為您調整。

備註: Plesk Migrator 應用了 Web 應用程式在遷移後正常運行必需的大多數修復。但是,它不能涵蓋所有可能的情況,特別是自訂配置。如果您的 web 應用程式在遷移後無法工作,則需要手動修復該問題。

在遷移過程中,Plesk Migrator 會自動調整以下 Web 應用程式:

  • WordPress
  • Joomla!
  • Drupal(僅 7.x 版本和更新版本)
  • PrestaShop
  • Magento
  • 使用 web.config 文件的 Generic ASP.NET (例如,DotNetNuke)

Plesk Migrator 會調整 web 應用程式,通過:

  • 更改應用程式設定檔中資料庫伺服器的主機名稱或 IP 地址。
  • 更改 .html.php.aspx 檔內的路徑。
  • (Plesk for Windows) 更新 web.config 檔(例如,如果原始伺服器安裝了 .NET 2,而目的伺服器有 .NET 4)。

以下是 Plesk Migrator 更改的應用程式設定檔:

Web 應用程式 設定檔
WordPress wp-config.php
Drupal(僅 7.x 版本和更新版本) settings.php
Joomla! configuration.php
PrestaShop settings.inc.php
Magento

(Magento 1) app/etc/local.xml

(Magento 2) app/etc/env.php

使用 web.config 文件的 Generic ASP.NET 應用程式

例如:DotNetNuke

以 「.config」 結尾的名稱

示例 1

您已經在使用本地資料庫伺服器的 Plesk 伺服器上託管的網站上安裝了 Magento。您想要將其遷移到使用遠端資料庫伺服器的 Plesk 伺服器。除非更改 Magento 配置,否則遷移後應用程式將停止工作。

Plesk Migrator 可以通過自動使用 Magento 設定檔 app/etc/local.xml 中遠端資料庫伺服器的 IP 位址替換 localhost 來幫助 Magento 繼續在目的伺服器上運行。

Configuration file '/var/www/vhosts/myapps.tld/httpdocs/magento/app/etc/local.xml' of application 'Magento': adjusted database host.
Line #43 of the file was changed.
Before fix: <host><![CDATA[localhost:3306]]></host>
After fix: <host><![CDATA[10.52.143.116:3306]]></host>

示例 2

您的網站檔會存儲在原始伺服器上的 /home/example.com 中。您已遷移了網站,其檔現在存儲在目的伺服器上的 /var/www/vhosts/example.com

Plesk Migrator 可以更改 PHP 檔中的路徑,如下例所示。

File '/var/www/vhosts/example.com/httpdocs/shop/order.php': fixed paths that were updated during migration.
Line #42 of the file was changed.
Before fix: $priceXml = '/home/example.com/shop/price.xml'
After fix: $priceXml = '/var/www/vhosts/example.com/httpdocs/shop/price.xml'

關閉調整 Web 應用程式

預設情況下,Plesk Migrator 在遷移期間會調整 web 應用程式。如果您想手動調整應用程式,或者想加快遷移速度,可以讓它跳過調整應用程式。

若要關閉調整 web 應用程式,請如下操作:

[GLOBAL]
...
# [optional] adjust-applications
# Whether to fix configuration files of several commonly used web applications.
# The fix could include database connection changes, path fixes, and so on.
# By default this option is enabled. You could disable it if it breaks migration of some
# application, or if you need better speed of migration.
adjust-applications: false