Last update at :2024-06-13,Edit by888u
When we choose a virtual host or VPS, sometimes we choose to change service providers or different machines for various reasons, which will definitely involve moving the website. There are many novice webmasters who may be a little unfamiliar with moving websites. Most of us now use PHP+MYSQL programs, which are different from ASP+ACCESS. It just so happens that Snail has a VPS website that needs to be moved today. After searching, I saw about I have not written a tutorial on VPS moving, so I will summarize it as follows.
I use two methods to operate the two websites, semi-automatic manual and command-based automatic moving.
Article Directory Hide
The first type, semi-automatic manual
The second type, automatic
The first type, semi-automatic manual
This method is more suitable for novices and requires fewer commands. We back up the website files and database to the desktop, then pour them into the website corresponding to the new machine environment, decompress the files and import the database.
The first step is to backup the website files through the tar command (how to use the tar.gz compression command on Linux VPS) and package the website files into the website directory and use the FTP tool to download them to the local desktop.
The second step is to log in to PHPMYADMIN to back up the database of the website and download it locally.
The third step is to set up the environment in the new VPS host, add the website and database, upload the file to decompress, import the database, and modify the database binding connection.
The fourth step is to test open the moved website and check whether the website is pseudo-static or the page is normal.
Sometimes I prefer this method, so that I can back up the data locally.
The second type, automatic
The so-called automatic method uses a lot of scripts, such as backing up files on the original VPS machine and then directly importing them into the new machine through commands.
The first step is to use the tar command to back up the file from the original VPS, and then download it to the new machine built through wget (do not resolve the domain name first, or point to the original VPS IP)
Second step, in the original VPS, use \\"Linux VPS using command to quickly import/backup MYSQL database method\\" to back up the database and restore it to the new machine.
The third step is to modify the database binding in vi
The fourth step is to modify the domain name resolution to the new IP. After it takes effect, check whether the website is normal.
Problems that need attention. Unless we have to replace the machine, it is generally recommended to replace the machine less often, as it will have a slight short-term impact on the website. Even if we want to replace the machine, we can choose to keep the old machine for about a week before shutting it down.
Recommended site search: Ministry of Industry and Information Technology domain name registration query, mainland China dynamic IP proxy, server rental US high-defense, free virtual host application, me domain name registration com domain name price, shopex space, Hong Kong server, Domain name information query, domain name quick registration,
发表评论