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 in­struc­tions here.

We recommend that you make a copy of your WordPress in­stall­a­tion and install it on your computer. You can use this local WordPress in­stall­a­tion, for example, to test new plug-ins before in­stalling 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, however, the process is basically the same.

Pre­par­a­tions

Required programs

There are various programs that you can use to set up a local WordPress in­stall­a­tion. 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 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.
  • The local WordPress in­stall­a­tion must be adapted later. For this purpose we have down­loaded the plugin Better Search & Replace.

Procedure

The setup of a local WordPress in­stall­a­tion consists of the following steps:

  • Download WordPress files: Download all files from your WordPress in­stall­a­tion via an FTP program and copy them to your computer.
  • Identify and export database: You can Control Pan­elidenti­fy and export the database of your WordPress in­stall­a­tion by means of the
  • Import and customise database: You import the exported database and adjust it using XAMPP.
  • Customise file: For WordPress to work locally, you must customise a file
  • Customise links: Use a plugin to adapt the links to your local WordPress in­stall­a­tion

Download WordPress files

  • Create a new folder under C:xamp­pht­docs. In this example: wp-test en­vir­on­ment
  • Remember this folder name. You will need it to log into the local WordPress in­stall­a­tion later, for example.
  • Using an FTP program, copy all the files from your WordPress in­stall­a­tion into the folder you created pre­vi­ously.

Identify database

If you don't know which database your WordPress in­stall­a­tion is using, then check the IONOS App Centre directory first:

  • Log in to your IONOS customer account.
  • Click on the IONOS App Centre Show all ap­plic­a­tions in Free Mode
  • Make a note of the database name of your WordPress in­stall­a­tion. Important is the part up to the first point.

Export database

  • Log in to your IONOS customer account.
  • Click Menu > 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.
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 in­stall­a­tion.

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

The locally installed PHPMy­Ad­min is opened.

  • Click Databases
  • Assign a database name and click Create.

The new database is displayed in the left pane. Import the pre­vi­ously exported database into this empty database.

  • Click on the new database
  • Click Import > Browse
  • Select your pre­vi­ously exported database. Click OK

The database is imported.

Cus­tom­ising 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 in­stall­a­tion can be reached. You must replace this URL with the local URL.

  • Click left on the table ending with "options
  • Click on Edit on siteurl
  • Enter the URL where your local WordPress in­stall­a­tion is located. In this example: http://localhost/wp-tes­tumge­bung/ Note: "wp-test en­vir­on­ment" 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
  • Click OK
  • For home, click Edit
  • Enter the URL of your local WordPress in­stall­a­tion again.
  • Click OK.

The changed entries must be in the option_value column.

Customize files

You must now customise the file wp-config.php. This contains the details of the database of your "correct" WordPress in­stall­a­tion. You must replace these with those of your local in­stall­a­tion.

  • Open the folder con­tain­ing your local WordPress in­stall­a­tion. In this example: C:xamp­pht­doc's
    wp-test en­vir­on­ment
Note

"wp-test en­vir­on­ment" 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 in­stall­a­tion DB_USER
    : root DB_PASSWORD
    : leave empty DB_HOST
    : localhost
  • Save the file

Customise links

The links of the local WordPress in­stall­a­tion still refer to your online in­stall­a­tion. With the help of the plugin "Better Search & Replace" for a com­fort­able search & replace this can be changed quickly.

  • Go to the admin area of your local WordPress in­stall­a­tion by entering the cor­res­pond­ing URL in your browser. In this example: http://localhost/wp-tes­tumge­bung/wp-admin.
Note

"wp-test en­vir­on­ment" 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 & Replace plugin.
  • Click Settings for the plugin you just installed.
  • Enter the URL of your "online in­stall­a­tion" in the Search for field.
  • Activate the option All - Search and Replace!
  • In the Replace with field, enter the URL of your local WordPress in­stall­a­tion. In this example: http://localhost/wp-tes­tumge­bung/
  • Click Start.

The changes are made.

  • Click Settings > Permalinks
  • Choose AcceptPost Name Changes

The local WordPress in­stall­a­tion is now set up.

Using local WordPress in­stall­a­tion

The following steps are necessary to use the local WordPress in­stall­a­tion:

  • Start the XAMPP Control Panel program.
  • Start Apache and MySQL
  • Enter the address of your local in­stall­a­tion in the browser. In this example: http://localhost/wp-tes­tumge­bung/ or http://localhost/wp-tes­tumge­bung/wp-admin

Use your local WordPress in­stall­a­tion as usual

Managed Hosting for WordPress
Create your site with AI, we manage the rest
  • Stress-free, no matter your skill level with easy AI tools
  • Full cus­tom­isa­tion with themes and plugins
  • Hassle-free updates and less admin
Go to Main Menu