Home > Tips > How to Transfer a Website Effectively

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.

Bookmark and Share


Related Posts:

Filed Under: Tips

2 Comments to “How to Transfer a Website Effectively”

  1. Brie Says:

    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

  2. KP Says:

    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/

Leave a Comment









*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word




Categories

Archives

Meta