Migrate a website between hosts (same account)

更新时间:
复制 MD 格式

Website migration is the process of moving a web application from one web hosting instance to another. If your source web hosting instance cannot be directly upgraded to the destination instance, and both instances are under the same Alibaba Cloud account, use this topic to migrate your website.

Prerequisites

  • The source and destination hosts are both Alibaba Cloud web hosting instances under the same Alibaba Cloud account.

  • The source and destination hosts support the same programming language and database type for the web application.

  • No other web applications are running on the destination host.

  • An FTP client is installed. We recommend using FileZilla. For instructions, see Manage web application files by using FileZilla.

Background information

  • This topic uses a WordPress site as an example, migrating from an exclusive web hosting Foundation Plus instance to an Advanced Plus instance, both running a Linux operating system.

  • Some web hosting products do not support automatic website data backups. You can manually back up your database and website data, upload the backups by using an FTP client, and then use this topic to complete the migration.

Procedure

  1. Manually back up the database data and website data from the source web hosting instance.

    For more information, see Back up and restore data.

  2. Download the backup data to your local computer.

    (Optional) Database data

    If your source website uses a database, back it up as follows:

    1. On the Database Backup tab, find the database backup that you created (for example, test_backup) and in the Actions column, click Download.

    2. In the dialog box that appears, click Download and then click Confirm.

      The backup file downloads to the Downloads directory on your local computer by default.

      The downloaded file is a compressed archive. Extracting the archive creates a backup folder named after the database, such as cdm81982910_db.

    3. Compress the database backup folder (for example, bdm72****320_db) into a .zip file, such as bdm72****320_db_example.zip.

    Website data

    1. On the Website backup tab, find the website backup that you created (for example, back_net_new) and in the Actions column, click Download.

    2. In the dialog box that appears, click Download and then click Confirm.

      The backup file downloads to the Downloads directory on your local computer by default.

      Extracting the downloaded backup archive creates an htdocs folder, which is the website's data directory.

    3. Compress the website backup folder (for example, htdocs) into a .zip file, such as htdocs_example.zip.

  3. Use an FTP client to upload the backup files to the root directory of the destination web hosting instance.

    1. Use FileZilla to connect to the destination web hosting instance.

      For instructions, see Manage web application files by using FileZilla.

    2. Upload the database backup ZIP package and the website's ZIP package to the /htdocs directory on the destination web hosting instance.

      For more information, see Upload website files to a Linux-based web hosting instance.

      Note

      If the destination web hosting instance uses a Windows operating system, upload the backup data to the / directory. For more information, see Upload website files to a Windows-based web hosting instance.

  4. On the destination web hosting instance, extract the uploaded database and website backup files.

    For more information, see Extract files.

  5. If your source website uses a database, import the database backup file into the database on the destination web hosting instance.

    For more information, see Import a database file by using Data Management Service (DMS).

    Important

    Skip this step if you are migrating for an upgrade, if the source host does not have a database, or if its database is not in use.

  6. Verify the migration.

    Open a web browser and navigate to the temporary domain name of the destination web hosting instance. If the website loads correctly, the migration is successful. For example, the presence of the default WordPress post "Hello world!" and sidebar widgets such as Search, Recent Posts, Recent Comments, Archives, Categories, and Meta confirms that all data was migrated.

Next steps

After migration, perform the following tasks to ensure the website runs correctly on the destination instance:

  1. Reset the database password. For instructions, see Reset the database password of a web hosting instance.

  2. Update the database connection string in your web application. For more information, see Database configuration file paths for common third-party open source web applications.

  3. Bind a domain name and configure DNS records. For instructions, see the following topics:

  4. Check and, if necessary, modify environment settings for your web application, such as the PHP version. For instructions, see Change the PHP version.