Backup and recovery of website data between VPS (website migration tutorial) [Original by Weimo Tribe]

Recently, the preferential information of VPS is not good, mainly because some new VPS service providers have emerged, Micro magic I'm sorry to recommend it to you directly. Today, I still don't want to send a discount code. Let's simply share the experience of data transfer between VPS. Of course, this article is still helpful for data backup, so I hope that the simple sharing of Micro Devil can "teach them to catch fish". Old bird passing by, welcome to laugh it off and put forward better suggestions~As usual, this article still includes two steps 1) Data packaging (backup) 2) Data transfer (recovery) I shared the tutorial of data migration from virtual host to VPS with you before. Welcome to move if you don't know how to change children's shoes Read the previous article ~

Backup and recovery of website data between VPS (website migration tutorial)

  1. Data packaging (backup)
  2. Data transfer (recovery)

The commands Debian and CentOS used in this article are common. The file directory is the same as LNMP by default. Please modify it accordingly.

For example, www.xxx.com is bound to the wwwroot directory of VPS1

1. Data packaging (backup) on VPS1

a. File data packaging on VPS1( Detailed explanation of Tar command

cd /home/wwwroot/
Tar zcvf xxx.tar.gz website directory (such as/home/wwwroot/vmvps. com)

b. MySQL data export on VPS1

Mysqldump - u username - p password database name>xxx.sql

2. Data transfer (recovery) on VPS2

a. File data recovery on VPS2 (wget gets remote files)

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

b. MySQL data import on VPS2

*Please first create the corresponding database and user in phpmyadmin (the same name as the original database and user)

wget http://www.xxx.com/xxx.sql
MySQL - u Your new user name - p User name Password The database name you just created<xxx.sql

This is the end of this article. I hope it will be helpful to everyone~and welcome you to point out the mistakes!

Guess you like

About the author: Micro magic

Small demons, great wisdom!

Multiple comments

  1. It seems successful to move to DZ forum by the way of building owner
    I don't know if there is a problem with UC communication, but this method should also be applicable to DZ forum

Post reply

Your email address will not be disclosed. Required items have been used * tagging