• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • About
  • Recommended Books
  • Tools
  • Journal
  • Hire Me
  • Contact
Small Biz Geek

Small Biz Geek

Small Business Design, Marketing & Technology Journal

Website design services

Nerdy analysis of small business design, marketing and technology

  • The Internet
  • Marketing
  • Graphic Design
  • Web Dev
  • Web Design
  • Social Media
  • Technology
  • Miscellaneous

Dodge WordPress Website Disasters: Use a Localhost for Development

Published: February 9, 2016; Updated: May 2, 2019 Filed Under: Software, Video, Web Development, WordPress

So, your WordPress website is online and doing well. Traffic is good, everything is fine, nothing bad has happened and you’ve been backing up frequently. Except…

WordPress Disaster

Except you want to perform maintenance and web development on your site.

Installing a plugin, editing code, changing the theme, upgrading to the latest version of the WordPress software. Theoretically simple stuff.

Three questions:

1. How do you propose to make back end changes? Are you poking around in functions.php? Surely, surely, surely you know not to tamper with the live software/code and risk breaking the public website?

You’d be surprised by what can wreck a WordPress with a few innocently misplaced clicks.

WordPress logo broken glass

2. What happens if/when you discover the WordPress backup you thought you’d successfully created is incomplete or contains errors?

Many webmasters dutifully create a database backup but don’t bother to check that it works.

phpMyAdmin database import error

3. Do you want to avoid website downtime, irritation to customers, disruption to business communications and loss of income?

WordPress websites break. It’s a PHP site running a MySQL database. With so many plugins and themes, compatibility issues seem to strike with perfectly bad timing.

Domino effect

Run an Identical Offline Copy of Your WordPress Website

The solution to website development hell is to do it safely and offline.

You want an identical development version of your business website running on your computer at all times. 

This is created using your WordPress database backup to reproduce a fully working copy inside an offline web server called a localhost.

It’s a development/dummy website in which all links are working, all images are present and the dashboard is fully accessible. It’s a test tube clone.

The difference between the offline and online site is that the latter is publicly accessible on your remote web hosting server while the offline version is for your eyes only.

Inside the localhost your public URL is swapped out for a local server URL.

localhost-small=biz-geek

https://www.smallbizgeek.co.uk becomes https://www.smallbizgeek.co.uk/

(There’s a video tutorial at the end of this post if you want to skip my explanation)

Have a WordPress “Fire Drill”

Never assume your live/public website on your webhost is somehow immune to disaster, because it’s not. Out of the box, WordPress is not all that secure, and I have even pointed out a WordPress vulnerability that can be patched inside phpMyAdmin.

Anyway, why wait until the shit hits the fan to find out whether you can or cannot restore your website?

Can you afford to take risks when you could just get into the habit of cloning your site to a localhost?

A stitch in time saves nine.

How often do you change your website? Are you adding new things regularly?

The basic idea is for you to update the offline/duplicate version of the website whenever the live website is updated.

It’s not just coding/development. What about all that valuable content. Don’t you want a working duplicate of all that too?

Assuming you already backup your database and web directory frequently, you’ve got most of what you need to set up your duplicated development site in the localhost.

There are three parts to the process of cloning your website:

  1. Download your database from the remote server database admin 
  2. Download any recently modified folders from the remote server directory
  3. Import both of the above into the offline server (localhost)

Of course, the last step requires the installation of software to set up your offline server.

WAMP

WAMP Server Stack

The excellent and well known WAMP server (Windows, Apache, MySQL, PHP) is a free server stack ideal for a CMS (content management system).

This seems to be the staple software for most serious WordPress users wanting to develop/test offline using Windows.

By default WAMP is installed to C:\wamp and creates a directory called \www\ which acts as the root directory.

WAMP www directory

WAMP www folder

Instant WP

Instant WordPress SoftwareThere’s also the free InstantWP which is portable, meaning it can be run without any installation. It can even be run directly from a USB flash drive.

I prefer WAMP for larger websites but you might prefer InstantWP initially if you’re new to all this. 

instant-wp-admin-default

The default root directory for Instant WP is a folder called \wordpress\ which is the equivalent of WAMP’s \www\ folder.

WordPress directory

Local Web Directory

Whichever type of local development server you decide to install, you’re going to need to keep all the directories up to date. 

About twice a week I clone Small Biz Geek to WAMP. I also copy the /wp-content/ folder into the C:\wamp\www\ folder on my computer.

You’re going to need to access your remote server web directory to actually copy the files over to your computer. Filezilla is very good (and very free).

Normally, the only remote directory you’ll need to copy is the /wp-content/ folder, since that is where uploaded images and plugins are saved.

wp-content copy

Whenever I add new images to a post using the media uploader, WordPress, by default, automatically saves these to /wp-content/uploads/ and so I’ll be sure to copy this to the localhost equivalent.

uploads folder

Beware of WordPress Software Updates

You might know already that updating the WordPress software can break your site. It’s happened to me and countless others.

When WordPress needs to update I’ll test it on my site locally. If the software upgrade goes without a hitch, I’m then confident I can safely do the same on my live website.

WordPress Update Framework

Similarly, if any plugins updates behave badly, it won’t matter if it’s happening inside the local version of my website. 

WordPress Plugin Updates

When Do You Need to Clone/Copy?

Let’s establish two common scenarios in which webmasters need to copy/clone a WP site:

1. Website is Offline/In Development

If the site is being developed before the public launch it’s usually created inside a local development server (the aforementioned localhost).

This stage of the build is like working in a shipyard. The incubation period protects your fledgling website until it’s ready to go online.

Indeed, once a site is completed, it will be cloned to the public webhost.

2. Website is Online/Live

If the site is already live and accessible by the public, it is on a remote server (webhost).

Each time a webmaster makes a major change or update, the website ought to be cloned and loaded into their localhost.

Your localhost is not only a shipyard, but also a kind of maintenance pit stop.

How to Clone Live WordPress Site to localhost

In the video demo below I’ll be cloning the site and reproducing it in the WAMP server manually. That means no plugins will be used.

Besides WAMP, the following tools are used in the video:

  1. phpMyAdmin (MySQL database administration interface)
  2. PuTTY (SSH Linux command line emulator for Windows – my favourite method for database admin) 
  3. Search Replace DB Master (free script for changing database URLs without breaking serialised data)

Watch video on YouTube

Analysis

Moore’s Law says, “Anything that can go wrong will go wrong.”

Because of this, I believe the phrase “better a little caution than a great regret” is wise. 

You might have put hundreds or even thousands of hours of work into your site. If you’ve ever lost data, you know how painful it is.

In business you cannot be prepared for EVERY eventuality. But you can at least mitigate some of the unpredictability.

Do the right thing and steer clear of any unpleasant situations that arise from someone or something buggering up the public version of your site.

Related Posts

  • Warning: Dubious Web Industry “Regulator” Selling Questionable Business Leads
  • Pssst! 16 Sneaky Snooping Tools for Spying on Competitors
  • Never Be Late for #Tweet Chats with Google Calendar Reminders (Free)

Filed Under: Software, Video, Web Development, WordPress Tagged With: Backup, CMS, Database, development, InstantWP, localhost, Offline, testing, WAMP, Websites, WordPress

Donations Welcome

If this article helped you in some way, you can buy me a cold beer or a hot coffee.
Donations are gratefully received.

About Small Biz Geek

I'm Darren, helping small businesses with design, marketing & tech.
Read more about me and follow me on Twitter.

Small Business Website Design

Do you need help with something web related?

To hire me see the page about my services.

Reader Interactions

Subscribe to Blog Feed by Email

Your email address won't be shared.

Comments

  1. Bastian Jancker says

    April 11, 2016 at 4:26 pm

    I lost one website because I wasn’t making backup. Never again.

    I now use BackWPup or my server weekly backup from my so if something goes wrong I can restore my website to a working state immediately.

    Great article btw.

    Reply
  2. Chandana Rai says

    July 27, 2018 at 4:21 pm

    This is amazing information, I got inspired after reading this blog!
    Please keep posting such informational blog. So that, people like us will get inspired and implement in real life.

    Thanking you

    Reply

Add Your Thoughts Cancel reply

Your email address is safe and will NOT be shared with anyone else.

Hateful, spammy or abusive comments will not be tolerated.

For more information please see the comment policy.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Search Website

Latest Journal Entries

  • Exposed: The Chinese Investment Fraud “Recovery” Scammer Deceiving Victims
  • Computer Says No: Does Your Website Work for People with Disabilities?
  • Chinese Tinder Profiles Are Using Photos of Pretty Girls to Scam “Investors”
  • Small Biz Owners “Trapped” Using Email Addresses Belonging to Internet Service Providers
  • In the Pandemic, QR Codes are Finally Proving Worthy in the West
  • Small Businesses Finally Start Marketing and All It Took Was a Global Pandemic
  • Unable to Meet in Person? Communicate Stress-Free with Online Audio/Video
  • UK Contractors Operating Ltd Companies Should Be Mad as Hell with HMRC and IR35
  • 20 Years On and Website Hit Counters are Still a Waste of Pixels
  • Competitors Can Easily Edit Your Google and Facebook Business Listings
  • Waiting on Final Images for a WordPress Website? Use Temporary Placeholders and Design Around Them
  • GoDaddy Loves Spamming Branded Footer Links to WordPress Installatron Sites

Footer

Primary Navigation

Home
About Darren
Good Books
My Tools
Blog Posts
Hire Me
Contact Me

Secondary Navigation

The Internet
Marketing
Graphic Design
Website Development
Website Design
Social Media
Technology
Miscellaneous

Derby & Nottingham Area

Small Biz Geek
Office 897
37 Westminster Buildings
Theatre Square
Nottingham
NG1 6LG

Telephone

Tel: +44 (0) 115 714 3290
Tel: +44 (0) 7951 897 243

VoIP

Skype: ilkestonwebdesign
WhatsApp: 07519 897 243

Email

[email protected]

Let’s Connect

Twitter
YouTube
LinkedIn
RSS

Subscribe to Blog by Email

Subscribe to Blog By Email
Genesis Framework by StudioPress


Copyright © 2022 · Small Biz Geek · Privacy Policy · Commenting Policy · Website Disclaimer · ICO number: ZA305900


Written and designed by Ilkeston Web Design