How to pull a static copy of a website

Darren Hagen

A client of ours recently found themselves in a bit of a pickle. They had a website that they no longer had hosting access to. The site was live but the developers they previously worked with were no longer willing to allow access to, or share, hosting information. They came to us looking for an alternative hosting option. The concern clearly in this case is if you don’t have the file/database access, then the site may not be able to be migrated to another host. They seemed to be SOL.
After further consideration we gave them a choice…they could either leave the site where it was and still utilize the CMS, or we could pull a static, straight HTML based, version of their site. They chose to pull the static one. The following is a free, quick, and easy way to make a static copy of a website through command line.

NOTE: The following will pull a static rendered version of the site and will not have any CMS files or databases. It is also subject to site size and may not work for larger sites. See ‘Further Information’ section at the bottom for ways to customize your download through HTTrack.

  1. Create a folder or environment to house the new files that will be created as a copy of the site
  2. Open Command Line
  3. Download Homebrew if you don’t already have it:
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  4. Download HTTrack:
    brew install httrack
  5. Run the following command making sure to change ‘example.com’ to the live site you want and ‘Downloads/location’ to where you want the files to end up
    httrack "http://www.example.com/" -O "Downloads/location" -v

Further information: If you would like more information pertaining to other ways to use HTTrack please go here

Credit: Joseph Levine (fjorge System Administrator)

Last updated by on .

What Are Your Thoughts?

Your email address will not be published. Required fields are marked *