Simple Application Server is a website hosting service. Alibaba Cloud continuously optimizes the specifications, performance, and stability of simple application servers. We recommend that you use simple application servers for website hosting. This topic describes how to migrate a website from a Web Hosting instance to a Linux simple application server.

Prerequisites

Background information

Web Hosting is an early website hosting service launched by Alibaba Cloud. Alibaba Cloud no longer updates the service and the outdated underlying architecture of the service cannot ensure the performance and stability of websites. We recommend that you migrate the websites deployed on your Web Hosting instance to a simple application server for hosting and maintenance. For more information about Simple Application Server, see What is Simple Application Server?.

This topic describes how to migrate a website from a Web Hosting instance to a simple application server in the International site (alibabacloud.com). The servers use the following sample configurations:
  • Web Hosting instance: the economic edition
  • Simple application server: the China (Hong Kong) region and the application image LAMP 7.4

Procedure

Step 1: Create a simple application server

Select the application image LAMP 7.4 and the China (Hong Kong) region to create a simple application server in the International site (alibabacloud.com). For more information, see Create a server.

Step 2: Back up the website data that is stored on the Web Hosting instance

  1. Use FileZilla to download the website data from the site root directory on the Web Hosting instance to your local computer. For more information, see Use FileZilla to upload and manage website files.
    Note You can back up website data to your local computer in a similar manner that you upload local files to a Web Hosting instance. You need only to drag the website data file in the site root directory to your local computer.
  2. Compress the website data that is downloaded to your local computer into a .zip file.
    In this example, the name of the compressed file is test.zip.

Step 3: (Optional) Back up the database data that is stored on the Web Hosting instance

You can use Navicat Premium to back up database data on the Web Hosting instance to your local computer.
Note If no database is deployed on your Web Hosting instance, skip this step.
  1. Obtain the username, password, and endpoint of the database.
    1. Log on to the Web Hosting console.
    2. On the Host List page, find the Web Hosting instance from which you want to migrate a website. Click Manage in the Operation column to go to the Instance Details page.
    3. In the Database section, view the username, password, and endpoint of the database.
  2. Connect to the database.
    1. Open Navicat Premium 16 and choose Connection > MySQL from the menu in the upper left corner.
    2. Enter the connection information based on the following figure, and click Test Connection. When the Connection Successful message appears, click OK, and then click OK. addad
      The following information describes the parameters to be configured:
      • Connection Name: Enter a custom name. test is used in this example.
      • Host: Enter the endpoint of the database. db- 32po****.aliapp.com is used in this example.
      • Port: Port 3306 is used by default.
      • User Name and Password: Enter the username and password of the database.
    3. Double-click the connection name of the database to connect to the MySQL database on the simple application server. dada
  3. Back up the database data.
    1. Double-click the name of the database to be backed up to open the database.
    2. Right-click the database name and choose Dump SQL File > Structure And Data. add
    3. In the dialog box that appears, save the SQL file to a specified storage path.
    4. If the following figure appears, the SQL file is dumped. Click Close. adsad

Step 4: Migrate the website data to the simple application server

You can use Xshell to upload the website data that is stored on the Web Hosting instance and backed up on your local computer to the simple application server.

  1. Configure a password for the simple application server if you create a simple application server for the first time. For more information, see Manage the password of a server.
  2. Use Xshell to connect to the simple application server.
    The following information describes the parameters to be configured:
    • Host Name: Enter the public IP address of the simple application server. For information about how to obtain the public IP address of a simple application server, see How do I obtain the public IP address of my simple application server?.
    • Protocol: Enter SSH.
    • Port number: Enter 22.
    • User name: Enter root.
    • Password: Enter the password that you configured for the simple application server.
  3. Run the following command to install lrzsz, which is used to upload the backup website file:
    yum install -y lrzsz
  4. Run the following command to delete files from /data/wwwroot/example:
    rm -rf /data/wwwroot/example/*
  5. Run the following commands to upload the backup website file to /data/wwwroot/example:
    cd /data/wwwroot/example
    rz
    In the dialog box that appears, double-click the test.zip file that you backed up in Step 2: Back up the website data that is stored on the Web Hosting instance.
    Note We recommend that you use the Xshell remote connection tool to connect to the simple application server. No dialog box appears to prompt you to select the file that you want to upload if you use some other remote connection tools to run the rz command.
  6. Run the following commands to decompress the uploaded test.zip file:
    yum install -y unzip
    unzip test.zip
    Note You need to replace test.zip in the preceding command with the actual compressed package name.
  7. In the address bar of your browser, enter the public IP address of the simple application server to test the connection.

Step 5: (Optional) Migrate the database data to the simple application server

If no database is deployed on your Web Hosting instance, skip this step.

  1. In the Simple Application Server console, add Port 3306. For more information, see Add a firewall rule. asdasd
  2. Obtain the username and password of the simple application server database.
    1. Log on to the Simple Application Server console.
    2. In the left-side navigation pane, click Servers.
    3. In the left-side navigation pane, choose Applications > Application Details.
    4. In the LAMP Information section, click Copy and then click Connect. xXX
    5. In the remote desktop that appears, right-click the blank space, paste the command that you copied, and press Enter to view the username and password of the database. 123
  3. Connect to the database.
    1. Open Navicat Premium 16 and choose Connection > MySQL from the menu in the upper left corner.
    2. Enter the connection information based on the following figure, and click Test Connection. When the Connection Successful message appears, click OK, and then click OK. xasa
      The following information describes the parameters to be configured:
    3. Double-click the connection name of the database to connect to the MySQL database on the simple application server. dada
  4. Create a database that has the same name as the database on the Web Hosting instance.
    1. Right-click the connection name of the database and click Create Database.
    2. In the dialog box that appears, enter the database name. Enter test in this example.
    3. Click OK.
  5. Right-click the MySQL database on the simple application server and select Execute SQL File. adad
  6. In the dialog box that appears, click... and select the backup SQL file that you saved in Step 3: (Optional) Back up the database data that is stored on the Web Hosting instance. ss
  7. Click Start and wait until the execution is successful. asda

What to do next

After the website is migrated, perform the following operations to ensure that the website runs properly on the simple application server: