How to Transfer a Website Effectively
April 7, 2005 Posted by KP
Tar command is the most effective way to transfer a website between servers:
1. On old server
Package DB data
# cd /var/db/mysql/db_name/
# tar cvzf /home/account_name/accountdb.tar.gz *
Package all files under the account’s home directory.
% cd /home/account_name
% tar cvzf account.tar.gz *
2. On new server
Add a new user with the same account name, also create a database for it.
Get the gz file with ftp from the old server and unpack it.
% cd /home/account_name
% tar xvf account.tar.gz
Unpack DB data.
# cd /var/db/mysql/db_name/
# tar xvf /home/account_name/accountdb.tar.gz
The website should be ready after updating named and Apache configuration file.
Related Posts:
Filed Under: Tips
March 23rd, 2010 at 12:16 am
Hi!
How are you determining ‘effective’ in this case? I know this post is old but have you considered rsync over SSH?
One command to move the web files and another similar one to move the db files. Something like this would be done from the machine you are moving files *to*:
rsync -e ssh -av username@oldserver.tld:/home/account_name/
What do you think?
–
Brie Aleida
March 23rd, 2010 at 12:32 am
It’s one time transfer, rsync may not be effective. Here is my another post for moving a server:
http://www.freebsdblog.org/127/move-a-server/