Home > Help Center > Applications > WordPress > Import WordPress Multisite with Subdirectory URL

Import WordPress Multisite with Subdirectory URL

You can install a WordPress multiuser with two types of URLs – sub-domains and sub-directories.

The choice of URL depends only on your personal preferences.

Sub-domains are considered to be a mostly separate sites from the root domain while sub-directories are seen as being more or less directly related to the root domain.

Google doesn't mind whether your site uses sub-directories, sub-domains or a root domain since they're all treated equally.

Unlike importing a WordPress site from a remote server using Softaculous, it's best to manually import the multi-site instead of looking for automatic solutions.

NOTE: When we mention site domain we mean the domain name of the main multi-site. You can follow these tutorials using separate domain (addon domain) or sub-domain as a site domain.

Import WordPress Multisite with Subdirectory URL

Here's a list of the necessary steps that will be described below in detail:

  1. Download files via FTP to the local computer
  2. Export a MySQL database archive from the remote server via phpMyAdmin to the local computer.
  3. Create and Configure site domain in CPanel
  4. Create a new MySQL database in CPanel
  5. Edit the wp-config.php file on the local computer
  6. Edit the content of MySQL archive on the local computer
  7. Import the multisite files into the multi-site directory via FTP
  8. Import the MySQL archive from the local computer into the new MySQL database

Note: Please follow the described order of actions because performing some tasks depends on whether previous steps have been completed.

Download files via FTP on your local computer

Log in with an FTP client using ftp account settings and download WordPress Multisite files on your local computer - you can refresh your knowledge on working with FTP.

Import MySQL database archive from the remote server via phpMyAdmin to the local computer

In the old hosting control panel, click on Databases > phpMyAdmin icon or link (or something similar depending on the hosting application manager), then click database name > click Export:

import multisite subdirectories

Click Go button:

import multisite subdirectories

If you feel insecure about working with PHPMyAdmin please read our article [link].

Create and Configure site domain

You have two options concerning Multisite site domain:

  1. The site will continue working with the same site domain after importing
  2. The site will work under new site domain after importing

In the first case you have to accomplish the following steps:

  • Configure the same site domain on the new server (while DNS will continue to route requests to the old server).
  • Create a record on your computer's hosts file for the site domain to the IP address of the new server so that your browser requests can be sent directly to the new server IP address, instead of being resolved by DNS.

If you want your Multisite to work with a different site domain, configure one in CPanel whether it is addon domain or subdomain.

In the example, we'll use a different site domain on the new host configured to work from the wpmuimport directory:

wpmuimport.example.com / public_html/wpmuimport

Create a new MySQL database in CPanel

Create a new database, create a new database user with secure password (we recommend you to use password generator if it is available), connect the database with the user, and grant the user all privileges in the database.

Write down all access data because you'll need it later.

In this article you can see an example of creating a new MySQL database.

Edit wp-config.php file on your local computer

Open wp-config.php file from the directory you downloaded earlier via FTP by using a text editor on the local computer (in the example we are using Notepad ++).

Find the MySQL settings section and replace the existing database, user, and password with the corresponding new database settings (be careful not to delete the single quotes around settings): import multisite subdirectories

A little further down in the same file, find the Multisite section and replace the old site domain with the new one:

wpmuremote.example.com > wpmuimport.example.com

import multisite subdirectories

Save the file with CTRL+S or click File > Save.

Edit the MySQL archive on the local computer

Using Notepad++ (or your code editor by choice with find/replace feature), open the .sql archive you exported earlier from the old host. With CTRl+F, open the Find window and enter the old site's domain).

Click on Replace tab and enter the new site domain name.

Check the Match case box and click Replace All button:

import multisite subdirectories

Close the program window and save the file.

##Create and Configure site domain in CPanel

In CPanel click Domains > Subdomains (or Addon if you are using one) and create new site domain:

import multisite subdirectories

import multisite subdirectories

Import Multisite files from local computer on the server via FTP

Log in with FTP client to the new server, navigate to your Multisite (in the example: /public_html/wpmuimport) directory.

Select all files with CTRL+A, right click on the selection and click Upload in the menu.

Import the MySQL archive from the local computer into the new database

In CPanel click Databases > phpMyAdmin. In phpMyAdmin click on the new database name > click on Import link:

import multisite subdirectories

Click Choose File, navigate to the edited MySQL archive and click Go button:

import multisite subdirectories

Upon successful import you'll get a similar message:

import multisite subdirectories

Once the FTP upload completes, enter the new site domain in the browser - the old site must be loaded correctly with the new site domain.

import multisite subdirectories

Log in admin panel with the existing username and password.

Test all network sites.

Add a new site.

All tests with the example sites are successful and we hope you are getting the same results following the steps in this article.

Still not finding what you're looking for?

Contact our support team with any additional questions or concerns.

Contact support