Blog · programming, web development

Your private sandbox: how to clone a WordPress site to your computer

2025-08-25

Know that fear? You have to make an important change on a client’s live site. One small mistake, one badly updated plugin – and the whole site, watched by hundreds of users, can go down. Working on a „living organism” is huge stress and risk.

Luckily there is a professional solution: a perfect 1:1 copy of the production site on your own computer. A private, safe sandbox where you can test, break and fix things with no consequences. In this guide we go through the whole cloning process step by step. It comes down to recreating three key elements: the files, the theme and the database.

Step 1: the foundations – a local environment (XAMPP + empty WordPress)

Before cloning, you need a „plot” for the copy. It will be a local XAMPP server and a clean WordPress install.

  • Start XAMPP: in the Control Panel start the Apache and MySQL modules – they simulate a server on your computer.
  • Create an empty database: go to http://localhost/phpmyadmin and create a new database (e.g. projekt_klienta) – you will need its name shortly.
  • Install a clean WordPress: create a project folder in C:\xampp\htdocs (e.g. klient-strona), download the latest WordPress and unpack it there, then go to http://localhost/klient-strona and run the famous 5-minute install using the empty database details.

Result: a working but empty WordPress site at a local address – a clean foundation.

Step 2: the equipment – downloading files from the server (FTP)

Now we download the site’s unique „equipment”: the plugins and the uploaded media.

  • Connect to the production server with an FTP client (e.g. the free FileZilla), using the client’s access details.
  • Find the main site directory (usually public_html or www).
  • Download only the two folders with unique files: wp-content/plugins and wp-content/uploads.
  • Paste them locally into C:\xampp\htdocs\klient-strona\wp-content, overwriting the empty versions.

Step 3: the heart of the code – cloning the theme (Git)

We fetch the theme via Git rather than FTP – that way we work on the same, current version of the code as the rest of the team, with the full change history.

Open a terminal (e.g. Git Bash or the one built into VS Code) and go to the themes folder of your local project:

cd C:\xampp\htdocs\klient-strona\wp-content\themes

Then clone the theme repository (the URL comes from the client):

git clone https://github.com/nazwa-firmy/nazwa-motywu.git

Git downloads the whole project and creates the theme folder.

Step 4: the soul of the site – migrating the database

This is the most important step – it moves all the content: pages, posts, settings, even users. We use the All-in-One WP Migration plugin.

On the production site: log in to the client panel, install and activate the plugin, go to All-in-One WP Migration → Export, choose „Export to → File” and download the ready .wpress file.

On the local site: log in to the local panel (http://localhost/klient-strona/wp-admin), install the same plugin, go to Import and upload the .wpress file. The plugin warns that the import will overwrite the local site – confirm, that is exactly the point.

Step 5: the grand finale – logging in and activating

After the import two important things happen:

  • You are automatically logged out of the local panel.
  • You need to log in again with the login and password from the production site – because the plugin also imported its users, and your old local credentials no longer work.

Finally, go to Appearance → Themes and activate the theme you cloned from GitHub. Done – the local site at http://localhost/klient-strona is now a fully functional copy of production, ready for safe work.

The process, though it has a few stages, is very logical and gives huge comfort. A local copy is the foundation of professional, stress-free work with web projects.

Back to all posts

Got a project to talk about?

Just tell me what you need - it does not have to be technical, that is my job. I will get back to you and tell you straight whether and how I can help.