Need to pull a static version of a live website?
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.
- Create a folder or environment to house the new files that will be created as a copy of the site
- Open Command Line
- Download Homebrew if you don’t already have it:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Download HTTrack:
brew install httrack
- 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)