# Copy WordPress website and safely test locally

In this tutorial, we'll show you how to create a local copy of your WordPress Web site. If you would like to move your WordPress website from another provider, you will find detailed instructions [here](https://www.ionos.com/digitalguide/hosting/blogs/wordpress-migration-tips-for-server-migration/ "WordPress Migration: Tips for server migration").

We recommend that you make a copy of your WordPress installation and install it on your computer. You can use this local WordPress installation, for example, to test new plug-ins before installing them on your "real" website.

If there are problems, it is always better to identify them on a test system. There you will have enough time for error analysis.

The steps described here refer to a Windows system. On Mac or [Linux computers](https://www.ionos.com/digitalguide/server/know-how/linux-the-cost-effective-alternative-to-windows/ "Linux – the cost-effective alternative to Windows"), however, the process is basically the same.

## Preparations

### Required programs

There are various programs that you can use to set up a local WordPress installation. In this article we have focused on the following easy-to-use tools:

- Install a local web server and a MySQL database. In this example [XAMPP](https://www.apachefriends.org/de/index.html "XAMPP Website") was installed under the following folder: **C:xampp**

---

### Note

This program is also available for Linux and Mac.

---

- To download your WordPress files, you need an FTP program such as [FileZilla Client](https://filezilla-project.org/ "FileZilla Client").
- The local WordPress installation must be adapted later. For this purpose we have downloaded the plugin[ Better Search &amp; Replace](https://de.wordpress.org/plugins/better-search-replace/ "Better Search &amp; Replace").

### Procedure

The setup of a local WordPress installation consists of the following steps:

- **Download WordPress files:** Download all files from your WordPress installation via an FTP program and copy them to your computer.
- **Identify and export database:** You can Control Panelidentify and export the database of your WordPress installation by means of the
- **Import and customize database:** You import the exported database and adjust it using XAMPP.
- **Customize file:** For WordPress to work locally, you must customize a file
- **Customize links:** Use a plugin to adapt the links to your local WordPress installation

## Download WordPress files

- Create a new folder under **C:xampphtdocs**. In this example: **wp-test environment**
- Remember this folder name. You will need it to log into the local WordPress installation later, for example.
- Using an FTP program, copy all the files from your WordPress installation into the folder you created previously.

[![Image: Download files with FTP](https://www.ionos.com/digitalguide/fileadmin/_processed_/7/6/csm_dateien-herunterladen-01_en_ccb57a22c9.webp "Download files with FTP")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/dateien-herunterladen-01_en.png) Download files with FTP       ##  Identify database

If you don't know which database your WordPress installation is using, then check the IONOS App Center directory first:

- Log in to your [IONOS customer account](https://login.ionos.com/ "ionos customer account").
- Click on the **IONOS App Center** Show all applications in **Free Mode**
- Make a note of the **database name** of your WordPress installation. Important is the part up to the first point.

[![Image: Database of a WordPress installation](https://www.ionos.com/digitalguide/fileadmin/_processed_/2/e/csm_datenbank-identifizieren_en_bc31b778e8.webp "Database of a WordPress installation")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/datenbank-identifizieren_en.png) Database of a WordPress installation       ##  Export database

- Log in to your [IONOS customer account](https://login.ionos.com/ "ionos customer account").
- Click Menu &gt; Hosting in the title bar.
- In the Databases tile, click Manage.
- Click Open behind the desired database.
- On the menu bar, click Export.
- To start the export, click OK.
- Save the export file to your computer.

[![Image: Export database](https://www.ionos.com/digitalguide/fileadmin/_processed_/0/5/csm_datenbank-exportieren-03_en_8dcfe7c207.webp "Export database")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/datenbank-exportieren-03_en.png) Export database       ---

### Note

Make a note of the file name and location of the exported file. You must import these in the next step.

---

## Install WordPress locally

All steps in this section require that your local web server (Apache) and the local database (MySQL) are started. If you have stopped these modules in the **XAMPP Control Panel**, you cannot use the local installation.

### Import database

You must import the exported database into a new, empty database on the local web server.

- Start the **XAMPP Control Panel** program.
- Start **Apache** and **MySQL**
- For **MySQL**, click **Admin**

[![Image: Starting Apache and MySQL](https://www.ionos.com/digitalguide/fileadmin/_processed_/2/a/csm_xampp_apache-mysql-starten-01_9ecc8ce303.webp "Starting Apache and MySQL")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/xampp_apache-mysql-starten-01.png) Starting Apache and MySQL       The locally installed PHPMyAdmin is opened.

- Click **Databases**
- Assign a database name and click Create.

[![Image: Create database](https://www.ionos.com/digitalguide/fileadmin/_processed_/0/f/csm_datenbank-anlegen-01_en_373c6d6024.webp "Create database")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/datenbank-anlegen-01_en.png) Create database       The new database is displayed **in the left pane**. Import the previously exported database into this empty database.

- Click on the **new database**
- Click **Import** &gt; **Browse**
- Select your previously exported database. Click **OK**

The database is imported.

##### Customizing the Local Database

In the database the entries "**siteurl**" and "**home**" have to be changed manually. Both still contain the URL at which your "correct" WordPress installation can be reached. You must replace this URL with the local URL.

- Click left on the table ending with "**options**

[![Image: Edit database](https://www.ionos.com/digitalguide/fileadmin/_processed_/e/a/csm_datenbank-editieren-01_en_d13655de09.webp "Edit database")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/datenbank-editieren-01_en.png) Edit database       - Click on **Edit** on **siteurl**
- Enter the URL where your local WordPress installation is located. In this example: http://localhost/wp-testumgebung/ Note: "wp-test environment" is the name of the folder you created in the section "Download WordPress files". If you have chosen a different folder name, you must enter it here

[![Image: Edit database](https://www.ionos.com/digitalguide/fileadmin/_processed_/8/2/csm_datenbank-editieren-02_en_2be5c64fc4.webp "Edit database")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/datenbank-editieren-02_en.png) Edit database       - Click **OK**
- For home, click **Edit**
- Enter the URL of your local WordPress installation again.

[![Image: Edit database](https://www.ionos.com/digitalguide/fileadmin/_processed_/c/c/csm_datenbank-editieren-04_en_f35319a827.webp "Edit database")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/datenbank-editieren-04_en.png) Edit database       - Click OK.

The changed entries must be in the option\_value column.

### Customize files

You must now customize the file wp-config.php. This contains the details of the database of your "correct" WordPress installation. You must replace these with those of your local installation.

- Open the folder containing your local WordPress installation. In this example: C:xampphtdoc's
**wp-test environment

---

### Note

"wp-test environment" is the name of the folder you created in the "Download WordPress files" section. If you have selected a different folder name, you must enter it.

---

- Open the file **wp-config.php** in a text editor such as Notepad
- Enter the following data: DB\_NAME
: Name of the database of your local WordPress installation DB\_USER
: root DB\_PASSWORD
: leave empty DB\_HOST
: localhost

[![Image: Edit file](https://www.ionos.com/digitalguide/fileadmin/_processed_/3/c/csm_dateien-editieren_wp-config-02_en_5dda020ebe.webp "Edit file")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/dateien-editieren_wp-config-02_en.png) Edit file       - Save the file

### Customize links

The links of the local WordPress installation still refer to your online installation. With the help of the plugin "[Better Search &amp; Replace](https://de.wordpress.org/plugins/better-search-replace/ "Better Search &amp; Replace")" for a comfortable search &amp; replace this can be changed quickly.

- Go to the admin area of your local WordPress installation by entering the corresponding URL in your browser. In this example: http:**//localhost/wp-testumgebung/wp-admin.**

---

### Note

"wp-test environment" is the name of the folder you created in the "Download WordPress files" section. If you have selected a different folder name, you must enter it.

---

- Install the Better Search &amp; Replace plugin.
- Click **Settings** for the plugin you just installed.
- Enter the URL of your "online installation" in the **Search for** field.
- Activate the option **All - Search and Replace!**
- In the **Replace with** field, enter the URL of your local WordPress installation. In this example: http:**//localhost/wp-testumgebung/**
- Click **Start**.

[![Image: Search &amp; Replace with Better Search &amp; Replace](https://www.ionos.com/digitalguide/fileadmin/_processed_/4/2/csm_url-ersetzen-01_en_22a470897e.webp "Search &amp; Replace with Better Search &amp; Replace")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/url-ersetzen-01_en.png) Search &amp; Replace with Better Search &amp; Replace       The changes are made.

- Click **Settings &gt; Permalinks**
- Choose **AcceptPost Name Changes**

The local WordPress installation is now set up.

## Using local WordPress installation

The following steps are necessary to use the local WordPress installation:

- Start the **XAMPP Control Panel** program.
- Start **Apache** and **MySQL**
- Enter the address of your local installation in the browser. In this example: http://localhost/wp-testumgebung/ or http://localhost/wp-testumgebung/wp-admin

Use your local WordPress installation as usual


This is a markdown version of: [https://www.ionos.com/digitalguide/hosting/blogs/copy-wordpress-and-test-locally/](https://www.ionos.com/digitalguide/hosting/blogs/copy-wordpress-and-test-locally/) for AI/LLM consumption.