Last update at :2024-06-28,Edit by888u
In November, there are still many promotions for cloud hosting providers. Some netizens or customers who need to change servers recommend purchasing a three-year package, which is relatively more cost-effective. Some of the company's corporate website customers have servers that are still a few months away from expiring. Generally, our customer service department will notify them to purchase new servers. Of course, it is indeed cheaper to use new accounts. One of the customers purchased a new server and needed to change the domain name, but the data was still the same.
If you encounter such a problem, the server needs to be replaced and relocated, and the domain name needs to be changed. What is the operation process like? Here Lao Zuo (LAOZUO.ORG) records his rough operation process. My usual quick method, if it is a server with the same server merchant or server with the same account, directly back up the image and install the image in the new server, and then change the domain name.
Article Directory Hide
First, back up data and configure the new server
Second, migrate data and reconfigure SSL and links
Third, replace the static files of the original website in batches
First, backup data and new configuration server
1. Back up website data
If we are on the same server, we will see if the server vendor supports backup images, and then it will be faster to migrate the images. But here it is a different server account, although it is a service provider. So we still backed up the data honestly and directly packaged the database and website files. Because the corporate website was only a dozen megabytes, Lao Zuo downloaded it directly to the local computer and threw it to the backup server.
If the user's server website is 200GB like we encountered before, we need to use the intranet or SCP to remotely transfer it directly to the new server.
2. Configure the new server environment
I won’t go into configuring the server environment here. We decide whether to install Pagoda Panel or LNMP according to our own habits. This depends on our own familiarity. If you are a technical expert and like the compilation environment, I will not stop you. In short, I personally suggest that the configured environment software version should be similar to the previous environment, such as the PHP version or the MYSQL version. If there is software for special environments, we will need to supplement it separately.
Second, migrate data and reconfigure SSL and links
Now that the new environment is installed and the data is backed up locally. We will directly add the new site to the new server. Of course, in this customer we need to use a new domain name. The original domain name is no longer in use. So I will add the new domain name to the current server, and then drop the database and data files into the current directory. Database import new database account.
We unzip the website files into the current new website domain name directory. After completion we need to modify the database connection. We are definitely not able to do it at this time. I found that this customer still has an SSL certificate installed. If the migrated website has a different domain name, we cannot share the original SSL certificate. We need to purchase a new SSL or use a free certificate when configuring the website with a new domain name.
We still cannot open the website at this time, because we still need to modify the two original domain names in the fields in the current database. Modify siteurl and home in the wp_options table to new website links.
Third, replace the static files of the original website in batches
Since we are using the data from the original website, the template has not changed. We need to modify the domain name of the original website in the website template to the domain name of the new website. But we can't modify the original addresses in the database one by one. Isn't it very tiring? So we need to use plug-ins. Here we can use the WPReplace plug-in (https://www.laozuo.org/14733.html).
Here we can batch replace the original URL with the new URL.
To summarize, let’s finally check to see if the website is normal, including whether the green lock of the SSL certificate is complete. Generally, we do not recommend changing domain names easily. However, as a corporate website, the domain name was originally thought out in a hurry. Now, it is common to use a better domain name.
Recommended site searches: domain name registration website, Japanese server rental Japanese server, website registration domain name query, free space in the United States, Korean server recommendation, ip online proxy, free space, server high defense Hong Kong Chinese domain name registration query, query ip address,
发表评论