🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

Correct Methods and Precautions for Migrating a WordPress Website to a New Server

Recently, Tencent Cloud had a promotion where a 2-core 4GB RAM 5Mbps configuration costs only 1200 for 3 years (Sign-up Address). I purchased one yesterday, and since I needed to change the Theme for Naibabiji, I started working on the website migration. Specific issues encountered during the migration will be shared later; first, let's talk about the correct method for moving a WordPress website.

The Correct Method for Changing Servers for a WordPress Website

For more methods, directly refer toofficial documentation, Naiba shares the simplest one here.
  1. Compress and package all website folders on the old server, then upload and extract them to the website directory on the new server.
  2. Export the database from the old website, then upload it to the database on the new server.
  3. If the database information differs between the old and new servers, simply modify the corresponding information in the wp-config.php file in the website's root directory.
These three steps complete the WordPress website migration. Remember to update the domain's DNS resolution to point to the new server's IP address.

Precautions for Moving a WordPress Website

  1. Disable all plugins on the old server before migrating.
  2. Delete cache files and any special caching plugins on the old server before migrating.
  3. Do not immediately stop using the old server, as Baidu can be slow and may still crawl data from the old server.

Pitfalls Encountered by Naiba During Website Migration

Actually, I've migrated WordPress many times and shouldn't have messed up, but this time it still went wrong. The issue was with Memcached caching. Because the migration was happening simultaneously withWordPress Themereplacement, and the demo data for the theme currently used on Naibabiji is quite large, with poor network connectivity on domestic servers, so Naiba specifically set up aLinodeserver to migrate first, then import the theme data, make modifications, and finally move to theTencent Cloudnew server. Since it was my first time dealing with a theme that comes with its own theme editor, I worked on it until very late. Everything was configured and modified correctly on Linode, but when I moved to the Tencent Cloud server, the appearance was different from what I saw on Linode. Moreover, WordPress theme modifications didn't take effect, and setting the default page as the homepage didn't work either. The caching plugins were all deleted, yet there were still bugs. After getting up today, it suddenly occurred to me: could it be because of the object-cache.php file? Sure enough, when I deleted the object-cache.php file, everything worked normally. I wasted several hours just because of this.What is object-cache.php used for?object-cache.php is a file required for Memcached caching. When Naiba was setting up the environment on the new Tencent Cloud server to save time,after LNMP was installedthe Memcached extension was also installed for convenience. Then, when the website was migrated, it automatically took effect (bypassing WP Super Cache settings). Ironically, trying to save time ended up costing me more time. What a pitfall.

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step instead.

「Naibabiji WordPress Website Building Coaching」 — From selecting a domain and purchasing hosting to installing themes and publishing posts, I「ll guide you through every step, helping you avoid detours and reach your goals directly.

👉 Learn about Website Building Coaching Service
🔒

Comments are closed

The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.

×
二维码

Scan to Follow