Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tar & untar a complete website

Status
Not open for further replies.

SM777

Technical User
Mar 7, 2001
208
GB
I'm moving my site to a new server. How do I completely tar the old website into 1 file and then untar on the new server?

What I'd like to do is to tar all files in the

/home/acme directory including all subfolders, .htaccess files etc.

and then download the tar, upload to the new server then untar.

Is it possible to preserve all the file and directory access rights (755 etc.) too?

 
When I did this with my own site, I think that what you're looking for is what tar did by default. In my I used tar cvzf web.tgz * to create the archive, and in my new I used tar xvzf web.tgz to put everything back as it was.

man tar is never a bad idea!
 
When I did this with my own site, I think the default tar behavior did what you're looking for. In my I used tar cvzf web.tgz * to create the archive, and in my new I used tar xvzf web.tgz and everything was back as it had been.

man tar is never a bad idea!
 
That worked fine. I had to gzip it then before I downloaded.

Do you know of a way to to the same thing but make a compressed image of the complete website?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top