Focus on cloud service provider activities
Notes on website operation and maintenance

Some problems to be noticed in WordPress whole station relocation and domain name change

Sometimes it is really troublesome to meet some customers. For example, today when a customer meets an enterprise website, he starts to decide which domain name to use. This is not a sudden change today, so he needs to change a domain name. The domain name to be replaced is not connected to the current server vendor, so it is necessary to move the website to a new server and replace it with a new domain name.

This doesn't just record the process of WordPress's whole station move. Maybe some netizens will need it later. In fact, no matter whether the above website is moved or the domain name is changed, it is just necessary to back up the database and files, and check whether there are special plug-in requirements in the configuration environment. Lao Zuo was actually before“ New webmaster website backup moving process and several problems needing attention "It is introduced in the article. Here we will talk about the problem we are dealing with today in detail.

First, backup the database and files

Because the enterprise website does not have much database content, I directly export the database with phpmyadmin, and then download the database and files to the local after the website files are directly packaged in online ZIP, so as to make a backup. I have to make a record here. After the relocation and debugging, there is no problem. I have to make a new backup and throw it to the company's backup server, because the customer will need a new domain name.

Second, the configuration of the new server environment

There is no need to reconfigure the server here. The customer's new domain name is accessed in Tencent Cloud, so he directly found a Web environment where the company's Tencent Cloud server still has free space. After adding the site, he resolved the new domain name. Enterprise websites have one advantage. They don't have much traffic, as long as they can ensure that they can open stably. Generally, customers of enterprise websites tell them to buy independent servers. In fact, network companies usually place several enterprise websites on one server to save costs.

Third, import data from the relocation website

Here, drop the ZIP package into the root directory of the website, and import the database after creating the database. The client website here is built using the wordpress program, so you can directly modify the database connection in the wp-config.php file. If the cache plug-in has been used before, delete the plug-in file directly, and then reconfigure the cache plug-in.

This is not the end, because the old domain name is used, and the new domain name needs to be replaced.

 If you are moving, change the domain name

We need to go to the database wp_options table to find that the two URLs, siteurl and home, are new. At the same time, we need to change the original URL in the website content in batches. Here, we directly use plug-ins, which are direct MySQL scripts.

UPDATE wp_posts SET post_content=REPLACE (post_content, 'original content', 'new content');

It can be replaced if it is more practical.

UPDATE wp_posts SET post_content = REPLACE( post_content, ' www.laozuo.org ', ' www.laobuluo.com ' ) ;

The website is just an example, which can be changed according to our actual needs.

IV. Other miscellaneous matters

After the domain name is changed, it is not good. Because there are some original URLs in the template, you have to download the template to the local site and then replace the URLs with new ones in batch through DW. This customer has even used SSL certificates. Here, he goes to buy another certificate (if the customer has paid for it, you can't fool him for free, and he will find you later), and then bind the certificate to the website.

At first, I didn't notice that there was a certificate, so I had to redo the previous URL replacement and add https.

Finally, if there is no problem in debugging, it can be delivered for use. It will take 2-3 hours to toss and turn, so it won't last for half a day. In this way, we can realize the whole station moving process of WordPress, and can change to a new wordprss domain name.

Vote for you
Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Some problems to be noticed in WordPress whole station relocation and domain name change