Menu Close

Website Backup With wget

This is a very simple, yet effective, method of pulling an entire website to your local machine on Linux, it uses the wget mirroring function, which will pull all pages, files and images

wget --mirror --convert-links --adjust-extension --page-requisites --no-parent

This is something I use on a regular basis when taking on a new website build, as it not only allows me to have a solid backup copy on my local machine, but also gives access to items like company logos and basic company information, which can then be used when putting together a proposed site design, so the customer can see exactly what it will look like with their branding, rather than some stock template.

Now, I will say, this is not the best method of making a backup, or the quickest, but its purpose is a little different than that, it can be used to provide a working copy of the site with little work.

If the site you are pulling is pure HTML, without a database in the back end, the chances are that the page linking will be relative (i.e. index.html or /images/image.jpg , so will require little to no modification to work.

In the case that linking is absolute (i.e., as is often the case with database backed sites, you will need to edit the code to make the linking relative.

There are some HTML editors, such as Coffee Cup, which are capable of finding a text selection and editing it, in all files within a folder, and/or sub-folders, these make the task very fast and easy to achieve, giving you a fully working offline copy of the site.

Leave a Comment