Quantcast
Channel: Tutorials — LowEndTalk
Viewing all articles
Browse latest Browse all 368

5-minute VPS Migration

$
0
0

Migrating VPSes may be painful, but this method can make it more effective. No addtional software requred, just tar and ssh command. You can move all 5GB data in 5 minites*. (Depend on speed port of your VPSes both sides, also file types).


Source IP: 1.2.3.4 Destination IP:5.6.7.8 (Complte your configuration first, such as LNMP)

Log into source vps via ssh, then enter the dir your directory. Now I want to move mysql data on /var/lib/mysql to new vps with same path.

root@source:~# cd /var/lib/mysql

Then type this command: tar czf - huluwadata | ssh root@5.6.7.8 tar xzf - -C /var/lib/mysql [This command means gzipped package is transferred to destination vps while ungzipping by ssh. So, your data is compressed when it's going to be transferred.] Dialog

Are you sure you want to continue connecting (yes/no)?

Type yes, press enter.

Warning: Permanently added '5.6.7.8' (RSA) to the list of known hosts. root@5.6.7.8's password:

Type your password, press enter. Then it's transferd, the only thing you just do is wating.(When display the such as root@source, complete! ) Ok, let's move my web scripts on /var/www

root@source:/var/lib/mysql# cd /var/www

Type following command. tar czf - huluwaweb | ssh root@5.6.7.8 tar xzf - -C /var/www Just do as aforementioned.

[You can move multi files with the command like this

tar czf - dir1 dir2 | ssh root@5.6.7.8 tar xzf - -C /var/www

]

At last, you should copy your webserver's conf file and reslove your domain to the new IP.


Viewing all articles
Browse latest Browse all 368

Trending Articles