Table of Contents
Migrate a WordPress Site from Sina App Engine to DigitalOcean
This note records the migration process I used to move a WordPress website from Sina App Engine (SAE) to a DigitalOcean droplet.
1. Redirect the SAE Domain
Open config.yaml in the SAE website root directory and add the following rule under handle:
- rewrite: if(in_header["host"] ~ "^www.yovisun.me" && path ~ "^(.*)$") goto "http://www.yovisun.com$1 [L,QSA,R=301]"
This redirects requests from the old SAE domain to the new domain with a 301 permanent redirect.
2. Buy or Prepare the New Domain
I bought the new domain on West.cn. After the domain is ready, point its DNS records to the DigitalOcean droplet IP address.
3. Create a DigitalOcean Droplet
Create a droplet on DigitalOcean using the one-click WordPress image. During setup, add an SSH key for login.
Generate an SSH key locally if you do not already have one:
ssh-keygen -t rsa -C "835570372@qq.com"
4. Convert the OpenSSH Private Key for PuTTY
If you use PuTTY on Windows, convert the OpenSSH private key to PuTTY’s .ppk format with PuTTYgen.
- Start PuTTYgen.
- Click Conversions > Import key.
- Select the private key generated by OpenSSH, such as
id_rsa. - Click Save private key and save it as something like
id_rsa_putty.ppk.
5. Log in to the Droplet with PuTTY
Open PuTTY and enter the droplet IP address or domain name. Then configure the private key:
- Go to Connection > SSH > Auth.
- Click Browse and select the
.ppkprivate key file. - Return to Session and save the session.
- Connect to the server.
On first login, follow the WordPress one-click image setup prompts. In my case, the default settings were acceptable, so I continued by pressing Enter.
6. Configure DNS
Set the DNS records for the domain to the droplet IP address. Create the corresponding records needed by the site, such as A records for the root domain and www subdomain.
After DNS changes, verify the domain resolves to the droplet:
nslookup www.yovisun.com
or:
dig www.yovisun.com
7. Update WordPress
Log in to the new WordPress dashboard and update WordPress, themes, and plugins before importing content. This reduces compatibility problems during migration.
8. Import the XML Backup
Use the pre-exported WordPress .xml backup file:
- Open the WordPress dashboard.
- Go to Tools > Import.
- Choose WordPress.
- Install the importer if needed.
- Upload the
.xmlfile and run the import. - Assign imported posts to the correct user.
- Choose whether to download and import file attachments, depending on whether the old site media URLs are still accessible.
After import, check posts, images, permalinks, and redirects before considering the migration complete.
