How to Import WordPress Multisite to WP Local

WP Local, a popular tool for local WordPress development, doesn’t natively support WordPress Multisite. However, you can still achieve this setup through a manual process.

In this guide, we will walk you through each step, ensuring a smooth transition from your current Multisite setup to a local environment.

Step-by-Step Guide

1. Create a Fresh WordPress Multisite in WP Local

First, create a new site in WP Local. During the setup, make sure to configure it as a WordPress Multisite. This option is available during the site creation process in WP Local.

2. Copy wp-content

Copy the wp-content folder from your existing WordPress Multisite to the wp-content folder of your newly created WordPress Multisite in WP Local. This ensures that all your themes, plugins, and uploads are transferred.

3. Export MySQL Database

Using PhpMyAdmin, export the MySQL database of your current WordPress Multisite. This will create a .sql file containing all your site data.

4. Edit wp-config.php

Open the wp-config.php file of your WP Local site and edit the port number. By default, WP Local uses port 100**, check your new WP local multisite database port. For example, in our case, its 10090. This step helps avoid the “Error: Failed to get current SQL modes. Reason: ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)” error when importing the database.

phpCopy codedefine('DB_HOST', 'localhost:10090'); // Adjust the port number accordingly

5. Open Site Shell

In WP Local, open the site shell for your new WordPress Multisite. You can usually find this option by right-clicking on your site in WP Local and selecting “Open Site Shell.”

6. Import MySQL Database

Within the site shell, run the following command to import the exported MySQL database:

shCopy codewp db import path/to/your-database.sql

Replace path/to/your-database.sql with the actual path to your exported .sql file.

7. Update Domain

Use the WordPress Multisite Domain Replacement Tool available at https://multisitedomainreplace.flywheelsites.com/ to update the domain information. Ensure you replace the original domain with the new local domain. Do not include ‘www’ in the local domain.

8. Edit wp_blogs Table

After updating the domain, you need to manually edit the wp_blogs table in your database. Open PhpMyAdmin in WP Local, navigate to the wp_blogs table, and update the domain and path values to match your local setup.

Final Checks

  • Ensure all domains and paths are correctly set to avoid any broken links or missing content.
  • Verify that all your sites within the Multisite network are accessible and functioning correctly.

By following these steps, you should be able to successfully import a WordPress Multisite into WP Local.

Leave a Comment

trabzon escort yalova escort Samsun escort izmit escort nazilli escort