Last update at :2024-07-12,Edit by888u
Sometimes it is really troublesome to meet some customers. For example, today I met a corporate website customer who has decided on which domain name to use. If there is a sudden change today, he will need to change the domain name. The domain name that needs to be changed is not accessed by the current server provider, so the already completed website must be moved to the new server and the new domain name must be replaced.
This is not a good time to record the process of moving the entire WordPress site. Maybe some netizens will see it later and need to use it. In fact, regardless of the above website relocation or domain name change, it is nothing more than backing up the database and files, and checking whether there are special plug-in requirements in the configuration environment. Snail was actually introduced in the previous article "New webmaster's website backup and relocation process and several issues that need to be paid attention to". Here we will talk about the problem we dealt with today in detail.
First, back up database and files
Because it is a corporate website without much database content, I directly used phpmyadmin to export the database, and then directly packaged the website files in ZIP online and downloaded the database and files locally to make a backup. I have to make a record here. After the relocation is completed and the debugging is completed, there will be no problems. I will also have to make a new backup and throw it to the company's backup server, because the customer will need to use the new domain name later.
Second, configuration of the new server environment
There is no need to reconfigure the server here. The customer's new domain name is connected to Tencent Cloud, so I directly found a WEB environment with a company's Tencent Cloud server and free space. After adding the site, the new domain name was resolved. . Corporate websites have an advantage. There is basically not much traffic, as long as they can be ensured to be stable and open. Generally, corporate website customers tell them to buy independent servers. In fact, most Internet companies place several corporate websites on one server to save costs.
Third, import data from the relocation website
Here, drop the ZIP compressed package into the root directory of the website, and import the database after creating it. The customer website here is built using the wordpress program, so directly modify the database connection in the wp-config.php file. If you have used the cache plug-in before, delete the plug-in file directly, and the cache plug-in will be reconfigured later.
It’s not over yet, because the old domain name is used and needs to be replaced with a new domain name.
We need to find in the wp_options table of the database that the siteurl and home URLs are the new URLs. At the same time, we need to replace the original URLs in the website content in batches. Here we directly use the plug-in and the latter is a direct mysql script.
UPDATE wp_posts SET post_content = REPLACE( post_content, \\’Original content\\’, \\’New content\\’ ) ;
Just replace it if it is more practical.
UPDATE wp_posts SET post_content = REPLACE( post_content, \\’www.laozuo.org\\’, \\’www.laobuluo.com\\’ ) ;
The URL is just an example and should be changed according to our actual needs.
Fourth, other miscellaneous matters
It won't work after changing the domain name, because there are still some original URLs in the template, so you have to download the template locally and replace the URLs with new URLs in batches through DW. This customer actually uses an SSL certificate. Here he will buy another certificate (the customer has paid for it, so you can’t fool him with a free one. He will come back to you later), and then bind the certificate to the website.
I didn’t notice that there was a certificate at first, so I had to redo the previous URL replacement and add https.
Finally, it can be delivered without any problems during debugging. After tossing it back and forth for 2-3 hours, half a day is gone. In this way, we can realize the process of moving the entire WordPress site and replace it with a new WordPress domain name.
Recommended site searches: cc domain name, Beijing server rental, free cloud hosting, website registration number query, website registration domain name query, Hong Kong vps host, which server is the best, US domain name website, telecommunications server rental, php website space,
p>
发表评论