Linux VPS site files, database backup and replacement of the host moving steps

Source: Internet
Author: User
Tags vps

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.