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 :-)
Page 1 of 1
Moving websites How to move website to another node
#2
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
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
#3
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?
#4
Posted 12 April 2011 - 03:19 PM
shemeri, 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
#5
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"?
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"?
#6
Posted 12 April 2011 - 04:36 PM
shemeri, 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"?
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
#7
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?
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?
#8
Posted 12 April 2011 - 10:01 PM
shemeri, 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?
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
Share this topic:
Page 1 of 1

Help
This topic is locked











