Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Advertise on

5-minute VPS Migration
New on LowEndTalk? Please read our 'Community Rules' by clicking on it in the right menu!

5-minute VPS Migration

huluwahuluwa Member
edited March 2012 in Tutorials

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:
Destination IP: (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.

[email protected]:~# cd /var/lib/mysql

Then type this command:
tar czf - huluwadata | ssh [email protected] 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.]

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

Type yes, press enter.

Warning: Permanently added '' (RSA) to the list of known hosts. [email protected]'s password:

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

[email protected]:/var/lib/mysql# cd /var/www

Type following command.
tar czf - huluwaweb | ssh [email protected] tar xzf - -C /var/www
Just do as aforementioned.

[You can move multi files with the command like this

tar czf - dir1 dir2 | ssh [email protected] tar xzf - -C /var/www


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

Thanked by 1assassin



Sign In or Register to comment.