Migrate a website between hosts of different accounts

更新时间:
复制 MD 格式

Website migration is the process of moving a website program from one Web Hosting instance to another. If you cannot upgrade your current Web Hosting instance to the target instance and the source and target instances belong to different Alibaba Cloud accounts, follow the steps in this topic to migrate your website.

Prerequisites

  • The source and target hosts must be Alibaba Cloud Web Hosting instances under different Alibaba Cloud accounts.

  • The source and target hosts must support the same programming language and database type.

  • The target host must not contain any other website programs.

  • You have an FTP client installed. We recommend using FileZilla. For more information, see Manage website files by using FileZilla.

Background information

  • In this topic, the source host is a Linux-based Exclusive Web Hosting Basic Enhanced Edition instance and the target host is a Linux-based Exclusive Web Hosting Advanced Enhanced Edition instance.

  • Some Web Hosting products do not support automatic website data backups. You can log on to your Web Hosting instance by using an FTP client to obtain the website backup data, and then follow the steps in this topic to migrate the website.

Procedure

  1. Back up the database of the source Web Hosting instance and download it to your local machine.

    1. Log on to the Web Hosting console using the source Web Hosting instance's Alibaba Cloud account.

    2. Find the source Web Hosting instance and click Manage in the Actions column.

    3. In the left-side navigation pane, choose Tools > Backup and Recovery.

    4. On the Database Backup tab, find the latest system-generated backup and click Extract in the Actions column.

      You can create a database backup task or use a system-generated backup. For more information, see Back up and restore data.

      This example uses a system-generated backup.

    5. In the dialog box, click OK.

      The system redirects you to the My Tasks tab. Wait until the status of the extraction task changes to Extracted.

    6. Click the Database Backup tab, find the extracted backup, and click Download in the Actions column.

    7. In the dialog box that appears, click Download, and then click OK.

      After the backup data is downloaded, it is automatically saved to the Downloads directory on your local machine.

      Extracting the downloaded backup file creates a folder named after the task ID. This folder contains a database backup subfolder, such as cdm81982910_db.

  2. Back up the website data of the source Web Hosting instance and download it to your local machine.

    1. On the Website Backup tab, find the latest system-generated backup, and click Extract in the Actions column.

      You can create a website backup task or use a system-generated backup. For more information, see Back up and restore data.

      This example uses a system-generated backup.

    2. In the dialog box, click OK.

      The system redirects you to the My Tasks tab. Wait until the status of the extraction task changes to Extracted.

    3. Click the Website Backup tab, find the extracted backup, and click Download in the Actions column.

    4. In the dialog box, click Download, and then click OK.

      After the backup data is downloaded, it is automatically saved to the Downloads directory on your local machine.

      Open the downloaded backup archive (in ZIP format), which contains an htdocs folder.

  3. Use an FTP client to upload the backup files to the website root directory of the target Web Hosting instance.

    1. Use FileZilla to connect to the target Web Hosting instance.

      For more information, see Manage website files by using FileZilla.

    2. Upload the database backup SQL file and the website file archive to the /htdocs directory of the target Web Hosting instance.

      For more information, see Upload website files to a Linux-based Web Hosting instance.

      Note

      If the target Web Hosting instance runs a Windows operating system, you must upload the backup data to the / directory. For more information, see Upload website files to a Windows-based Web Hosting instance.

  4. Import the backup data to the target Web Hosting instance.

    1. Log on to the Web Hosting console using the target Web Hosting instance's Alibaba Cloud account.

    2. Find the target Web Hosting instance and click Manage in the Actions column.

    3. In the left-side navigation pane, choose Tools > Website Mover.

    4. On the Website Mover page, click Create Migration Task.

    5. Configure the database migration.

      1. In the Database Migration Settings wizard, click Browse.

      2. In the dialog box that appears, select the uploaded database backup SQL file and click OK.

      3. From the Target Database drop-down list, select the target host's database.

      4. Click Next.

    6. Configure the website file migration.

      1. In the Website File Migration Settings wizard, click Browse.

      2. In the dialog box that appears, select the uploaded website backup file archive and click OK.

      3. Click Next. Review the on-screen note, which explains file overwrite behavior and format limitations. Click Next to proceed, or click Skip Website File Migration to skip this step.

    7. On the Submit Settings tab, click Submit Settings.

      Be aware that the migration can take from several minutes to over half an hour, depending on the amount of data. After a successful migration, you must reset the database password, modify the database connection string in your website program, update your domain name resolution and ICP filing information, bind the domain name in the console, and configure settings such as the language version.

      After submitting the migration task, you can click View Details in the task's row to monitor its progress. Then, click OK to close the confirmation dialog box.

      A dialog box appears, reminding you to reset the database password, modify the database connection string, and update the domain name resolution after the migration. The task progress is displayed sequentially as Database Migration Task Submitted, Database File Preprocessing Successful, and Data Importing.

Results

When the migration is complete, the task status changes to Succeeded.

Next steps

After the website migration, you must complete the following steps to ensure your website runs correctly on the new Web Hosting instance:

  1. Reset the database password. For more information, see Reset the password of a Web Hosting database.

  2. Update the database connection string in your website program. For more information, see Paths to database configuration files of common third-party open-source programs.

  3. Bind the domain name and configure its resolution. For more information, see the following topics:

  4. Verify and, if necessary, update environment settings for the website program, such as the PHP version. For more information, see Change the PHP version.