Copy WordPress website and safely test locally

1 Reply

Please Note:

The text on this page was translated by translation software. A revised version from our editors will be available soon.

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.

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, however, the process is basically the same.

Tip: If you are using a 1&1 IONOSperformance server, you can alternatively use the "!</p>

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 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 installation must be adapted later. For this purpose we have downloaded the plugin Better Search & 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.
Download files with FTP

Identify database

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

  • Log in to the
  • <li>Click on the <strong>1&1 App Center</strong> <li>Show all applications in <strong>Free Mode</strong> <li>Make a note of the <strong>database name of</strong> your WordPress installation. Important is the part up to the first point.</li> </ul>
    Database of a WordPress installation

Export database

  • Log in to the
  • <li class="content-paragraph">Click <strong>Hosting</strong> &gt;<strong> Manage</strong> <strong>Webspace </strong>&gt; <strong>MySQL Database</strong> <li class="content-paragraph">Click on <strong>PHPMyAdmin</strong> &gt; <strong>Export</strong> &gt; <strong>OK</strong> behind the desired database.</li> </ul>

    You save the database on your computer.

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

    Export database

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
Starting Apache and MySQL

The locally installed PHPMyAdmin is opened.

  • Click Databases
  • Assign a database name and click Create.
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 > 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
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
Edit database
  • Click OK
  • For home, click Edit
  • Enter the URL of your local WordPress installation again.
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
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 & Replace" for a comfortable search & 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 & 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.
Search & Replace with Better Search & Replace

The changes are made.

  • Click Settings > 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 article was published on 24 Sep 2018 by sebastian.zientek as part of the topic WordPress .

1 Reply

Leave your reply

Just for kidding with https://whatstatus.co/whatsapp-dp-images

Leave your reply

The new 1&1 IONOS Community - hosting knowledge from experts for your success.