Skip to content

Database imports for multisite environments

Database structure for a WordPress multisite differs from the database structure of WordPress single site. In order to import a database to a VIP WordPress multisite network, the database file for import must be exported from a WordPress multisite.

A VIP Local Development Environment configured as a multisite can be a useful tool for testing the database import process.

Requirements

  • The database file for import must have been exported from a WordPress multisite.
  • If importing the database for an entire multisite network, ensure that the export has all tables listed in network-level tables shared by all sites.
  • If importing tables for a specific site, ensure the table prefixes match the intended destination site ID (e.g. tables prefixed wp_3_ will be imported to site ID 3). Table prefix values will be visible in the confirmation output of the import command.
  • If importing a selection of tables for one or more sites, the database export should include only the tables for those sites.
  • If the SQL file being imported includes tables for the main site (ID 1), and the domain value in the file for site ID 1 does not match a domain that has been mapped to the environment for import, the import will fail. To prevent this issue, update domain values either before or during the import, and update the domain value for site ID 1 with a domain that is mapped to that environment.
Screenshot of returned messages and warnings when running a database import to a WordPress multisite

Last updated: August 31, 2023

Relevant to

  • WordPress