VPS.NET Cloud Community: Moving websites - VPS.NET Cloud Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Moving websites How to move website to another node Rate Topic: -----

#1 User is offline   shemeri 

  • I Got Nodes
  • PipPipPip
  • Group: Customers
  • Posts: 67
  • Joined: 02-July 10

Posted 12 April 2011 - 02:12 PM

Hi,

I have just created a new server on different location. I need to move couple of websites to the new server, how do I do that?

I need to move 2 websites from Server A (London) to Server B (Amsterdam). Websites use mysql database too, so I need to move data as well as files?

Any suggestions :-)
0

#2 User is offline   thomsog 

  • I Got Nodes
  • Pip
  • Group: Customers
  • Posts: 9
  • Joined: 05-April 10
  • LocationHarrogate

Posted 12 April 2011 - 03:05 PM

Hi,

for database side - mysqldump --user=username --password=1234 --databases your_database > your_database.sql

Then to import - mysql --user=username --password your_database < your_database.sql

for htdocs -

cd /usr/local/apache/htdocs

rsync -arvz . root@new_server:/usr/local/apache/htdocs


Paths dependent on your setup off course.

cheers

Gaz
0

#3 User is offline   shemeri 

  • I Got Nodes
  • PipPipPip
  • Group: Customers
  • Posts: 67
  • Joined: 02-July 10

Posted 12 April 2011 - 03:09 PM

thanks but does it mean that I need rsync on both servers? If yes, is there any other way to do it faster using local ips or so?
0

#4 User is offline   thomsog 

  • I Got Nodes
  • Pip
  • Group: Customers
  • Posts: 9
  • Joined: 05-April 10
  • LocationHarrogate

Posted 12 April 2011 - 03:19 PM

View Postshemeri, on 12 April 2011 - 03:09 PM, said:

thanks but does it mean that I need rsync on both servers? If yes, is there any other way to do it faster using local ips or so?


Hi Shemeri,

If your not planning to use your "original" site again then you just need to rsync from your "original" server, and if you update the site then rsync again and it will only need to transfer any data thats changed. This changes though if you want changes to your new site to be transfered back to the "original" site.

I hope that makes sense :-)

Cheers

Gaz
0

#5 User is offline   shemeri 

  • I Got Nodes
  • PipPipPip
  • Group: Customers
  • Posts: 67
  • Joined: 02-July 10

Posted 12 April 2011 - 04:07 PM

I only need to move the website from "original" site and have it only on the new server. After moving from "original" server to new server, the site on "original" server will be deleted.

So do I use the following command for that?
rsync -arvz root@new_server:/usr/local/apache/htdocs
What does -arvz mean?


Even though, I don't have rsync on "new_server"?
0

#6 User is offline   anthonysomerset 

  • On Cloud 9
  • PipPipPip
  • Group: Customers
  • Posts: 618
  • Joined: 16-September 09
  • LocationLondon, UK

Posted 12 April 2011 - 04:36 PM

View Postshemeri, on 12 April 2011 - 04:07 PM, said:

I only need to move the website from "original" site and have it only on the new server. After moving from "original" server to new server, the site on "original" server will be deleted.

So do I use the following command for that?
rsync -arvz root@new_server:/usr/local/apache/htdocs
What does -arvz mean?


Even though, I don't have rsync on "new_server"?


-a archive mode (preserves permissions)
r recursive, will drill down directories etc
v verbose will print to terminal files etc
z compress will compress the traffic over the rsync compression
0

#7 User is offline   shemeri 

  • I Got Nodes
  • PipPipPip
  • Group: Customers
  • Posts: 67
  • Joined: 02-July 10

Posted 12 April 2011 - 04:37 PM

Followed what you wrote :-)
and files are moving to the new server right now.

Thanks alot.

One last question if you can answer me please.
Failover servers, do they work the same way. Making a CRON that executes the above command at a certain time to have a copy of the "original" site on the failover server?
0

#8 User is offline   anthonysomerset 

  • On Cloud 9
  • PipPipPip
  • Group: Customers
  • Posts: 618
  • Joined: 16-September 09
  • LocationLondon, UK

Posted 12 April 2011 - 10:01 PM

View Postshemeri, on 12 April 2011 - 04:37 PM, said:

Followed what you wrote :-)
and files are moving to the new server right now.

Thanks alot.

One last question if you can answer me please.
Failover servers, do they work the same way. Making a CRON that executes the above command at a certain time to have a copy of the "original" site on the failover server?


failover sync can work in a variety of ways, a cronn'ed rsync is just the simplest method, all the way through nfs shares to filesystem replication with stuff like glusterfs
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users