How to duplicate a live Magento site to local machine to test a new theme

How to duplicate a live Magento site to local machine to test a new theme

September 14, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to duplicate a live Magento site to local machine to test a new theme

A Step-by-Step Guide: Duplicating a Live Magento Site for Local Testing

Dear reader,

I understand your frustration all too well. Working on an unfamiliar e-commerce platform like Magento can indeed be challenging, especially when there’s no prior experience or documentation to rely on. Let me guide you through the process of duplicating your live Magento site to a local machine for theme testing.

Understanding the Magento Ecosystem

Magento is a robust open-source platform built on PHP and MySQL. It has a steep learning curve due to its extensive features and flexibility, but with some guidance, we can navigate it confidently.

Step 1: Backup Your Live Site

Before making any changes, always backup your site data. You can use an FTP client like FileZilla or Cyberduck to download the public_html folder from your client’s FTP server. This folder contains all the files needed for your Magento installation.

Step 2: Export the Database

The database holds crucial information about your products, customers, and orders. Use phpMyAdmin in cPanel to export a SQL file of your Magento database:

  1. Log into cPanel.
  2. Find the phpMyAdmin icon and click on it.
  3. Select your database from the left sidebar.
  4. Click on the ‘Export’ tab at the top of the page.
  5. Choose the ‘Quick’ method for simplicity’s sake, then click ‘Go’.

Step 3: Setting Up Your Local Environment

Prerequisites

Ensure you have the following installed on your local machine:

  • XAMPP or WAMP (for Windows) or MAMP (for Mac)
  • The PHP version compatible with your Magento installation (usually 7.1.x)

Installation Steps

  1. Install and run XAMPP/MAMP.
  2. Create a new folder in the htdocs directory for your project.
  3. Upload the public_html files from step 1 into this new folder.

Step 4: Importing Your Database

MySQL Workbench is a more efficient tool than phpMyAdmin for large database imports:

  1. Connect to your local XAMPP/MAMP MySQL server.
  2. Right-click on the ‘Innodb’ tab and select ‘Import…’
  3. Choose the SQL file exported in step 2.
  4. Click ‘OK’.

Using phpMyAdmin

If you prefer phpMyAdmin, follow these steps:

  1. Log into your local XAMPP/MAMP phpMyAdmin.
  2. Create a new database with the same name as your live site.
  3. Select this new database and click on the ‘Import’ tab at the top of the page.
  4. Click browse (or choose file), select the exported SQL file, then click ‘Go’.

Step 5: Connecting Your Local Site to the Database

  1. Open a text editor like Sublime Text or Atom.
  2. Navigate to app -> etc -> local.xml in your project folder.
  3. Update the database connection parameters to match your new MySQL server settings (found in XAMPP’s config file).

Step 6: Running Magento’s Install Wizard

  1. Open a web browser and navigate to http://localhost/your-project-name/install.php
  2. Follow the on-screen instructions, ensuring you delete the local.xml file first.
  3. Once installed, log into your local site with a test admin account.

A Note on Theme Testing

To apply a new theme, navigate to Content -> Design in the Magento backend. Click ‘Edit’ for the default store view, then click ‘Add New Skin’. Upload your theme files here and set it as active.

Remember, Magento’s default database is around 20MB, but an active site can grow significantly over time. This growth isn’t necessarily due to poor database management, but rather Magento’s extensive functionality. It’s important to optimize performance regularly.

Conclusion

Duplicating a live Magento site for local testing requires careful attention to the file and database structure. By following this guide, you should now have a functional copy of your site on your local machine ready for theme testing or other development work.

Don’t hesitate to reach out if you need further assistance. The Laravel Company specializes in e-commerce solutions, including Magento migrations and custom theme development.

Happy coding!

Catalog Database Themes Admin

Our network