Backup and recovery of Web site data between Linux VPS (site migration tutorial) _linux

Source: Internet
Author: User
Tags vps
This article uses the command Debian and CentOS General, the file directory default and lnmp the same, please make the appropriate changes.

An example of www.xxx.com binding on the Wwwroot catalogue of VPS1 in this paper

1.VPS1 Data Packaging (Backup)

A.VPS1 File Data Packaging (Tar command detailed http://www.jb51.net/os/RedHat/1219.html)

cd/home/wwwroot/
Tar zcvf xxx.tar.gz web site directory (e.g./home/wwwroot/vmvps.com)

MySQL data export on B.VPS1

Mysqldump-u User name-p password database name > Xxx.sql

Data transfer on 2.VPS2 (restore)

File Data recovery on A.VPS2 (wget get remote files)

cd/home/wwwroot/
wget http://www.xxx.com/xxx.tar.gz (get files from VPS1)
Tar zxvf xxx.tar.gz

MySQL data import on B.VPS2

* Please create a new database and user in phpMyAdmin (with the same name as the original database, user)

wget Http://www.xxx.com/xxx.sql
Mysql-u your new username-p username password you just created the database name < Xxx.sql

This article to end, I hope to help everyone ~ also welcome to point out the mistakes!

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.