Once the site to use the VPS, we need to do is operations, not only to ensure that the site can be stable operation, and the need to regularly back up the Web site files and databases, so as to avoid accidents can also use the data has been backed up and to restore and transfer VPS operations. Today, Chiang just need to give a VPS on the site to backup and transfer VPS operations, so the operation process recorded, so that users need to refer to the use of.
First, back up the Web site database
Mysqldump-uitbulu (database user name)-pitbulu.com (database password)--default-character-set=gb2312 itbulu (database name) > itbulu.sql (saved database format)
Back up the database to the site root directory.
Second, backup web site files
The code is as follows |
Copy Code |
TAR-ZCVF itbulu.tar.gz * |
Using the SSH tool to work with the files in the Backup Site Directory package, I am used to packing in tar.gz compressed format.
So far, we've backed up the site, and we just need to download it locally to complete the backup. General site, we will manually backup on a regular basis, if the data and content is more important, you can choose a regular, daily backup.
Third, the site moved to replace the server
If we need to move the site to another server or transfer data to another site, you can use the following procedure.
A-under the new VPS to build a good environment, add sites, transfer data to the new VPS site, can be downloaded with wget, relatively fast.
B-Extract and deploy directory
C-Add a new database and take advantage of a database restore
The code is as follows |
Copy Code |
Mysql-uitbulu-pitbulu.com Itbulu < Itbulu.sql |
After restoring the database, we only need to change the Web page file database connection to a new database link.
In this way, through the above 3 steps, we can complete the need to back up the site files, databases, and need to transfer the site to the new VPS operations