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

The Correct Method and Precautions for Changing Servers for a WordPress Website

Recently, Tencent Cloud is running a promotion where a 2-core, 4GB RAM, 5Mbps configuration costs only 1200 for 3 years (Get on board link), I purchased one yesterday, and coincidentally, I needed to change the theme for Naibabiji, so I started the process of migrating the website. I'll share the specific issues encountered during the migration later; first, let's talk about the correct method for migrating a WordPress site.

The Correct Method for Migrating a WordPress Website to a New Server

For more methods, refer directly toofficial documentation., here Naiba shares the simplest one.
  1. Compress and package all website folders on the old server, then upload them to the new server's website directory and extract them.
  2. Export the database from the old website, then upload it to the new server's database.
  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 name resolution to point to the new server's IP.

Precautions for Migrating a WordPress Website

  1. Disable all plugins on the old server before migration.
  2. Delete cache files and special caching plugins on the old server before migration.
  3. Do not immediately stop using the old server, as Baidu is quite 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 counts as a failure. The issue was with Memcached caching. Because simultaneously with the migration, there wasWordPress Themesa change, and the demo data for the theme currently used by 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 toTencent Cloudthe new server. Since it was my first time dealing with a theme that comes with its own theme editor, I worked late into the night. 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 also didn't work. 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. 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 installedhe also installed the Memcached extension for convenience, and then the website migration automatically took effect (without going through WP Super Cache settings). Unexpectedly, 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.

「Naibabiji WordPress Website Building Coaching Service」—From choosing a domain and buying hosting, to installing a Theme and publishing content, I「ll coach you through every step, helping you avoid detours and reach your goal directly.

👉 Learn about the 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 QR Code to Follow

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: