Import a WordPress Database

At this point, you should have an exported file saved locally on your computer called something like wp_yoursite.sql (e.g. in our previous article it was called abaybee_wrdp1.sql). We will now import your database file into your WP Engine environment.

If you are following along on the Migration Checklist in the User Portal or need a little more information, this is the first task in the Import Phase.

This section will walk you through accessing phpMyAdmin through our User Portal (our version of the cPanel), clearing out the current default database, and importing your database file.


Access phpMyAdmin

  1. Login to the User Portal
  2. Select the environment name to wish to import the database to
  3. Click phpMyAdmin at the top


Select Database

Expand the database name where you’d like to import the new database content by clicking the database name.

  • The primary database for the environment will be titled: wp_environmentname
  • If you have created a legacy staging site, you may see a second database called: snapshot_environmentname
2-phpmyadmin


Drop Database Tables

Before importing your database you must create a clean slate and make room for your incoming database.

  1. Click on Check All
  2. From the dropdown, select Drop
  3. Click Go
  1. Another screen will display confirming the change, click Yes

Typically all tables should be dropped before attempting a database import. These steps may need to be performed several times, until no tables show and the interface reads “No tables found in database.”


Import New Database

  1. Click on the tab Import
  2. Click on Choose File
  3. Locate the new database file on your local system and select it
    • In many cases this file is called something like wp_environmentname.sql
  4. Click Go
3-importsteps
  1. You will now see the new tables in the database, along with a report stating that the import has been successfully finished.

If your site contains existing revisions, please contact our support team from your User Portal prior to migrating or importing your content to avoid a loss of data.

NOTE: The server is limited to 50MB database imports. If you need to import a larger database, upload it using SFTP to _wpeprivate and contact Support to import the file.


Confirm Database Prefix

Once you have successfully imported your database, you will need to check if your table prefixes are different from wp_.

If your tables do not start with wp_, please read How to change the table prefix to ensure your site works properly on our system.

If your expected row count within phpMyAdmin doesn‘t match what’s on display, it may be due to how the table‘s information is handled within MySQL. To get more information on the desired table, run the following commands from the SQL tab within PHPMyAdmin after selecting a database:

View exact count of rows for a table:
SELECT COUNT(*) FROM wp_posts;
View information from PHPMyAdmin table status:
SHOW TABLE STATUS;


Failed Import

If your database import failed, there could be a few different reasons for this.

  1. Your database is too large, the maximum database import size is 50M. This limit is industry standard and cannot be increased. There are 3 alternatives:
    1. Upload the file to _wpeprivate using SFTP and reach out to Support to have it imported.
    2. Connect using SSH Gateway and import the database using WP CLI.
    3. Export the database from the previous host as groups of fewer tables, rather than the whole database.
  2. There was an issue with the exported content.
    • Attempt the export again, but this time with just a few tables. If this works continue importing tables a handful at a time until an issue is found.
  3. WP Engine runs daily maintenance processes that enforce limits on database options to preserve the stability of the site and the platform. Autoloaded rows (generally located within the wp_options table) are limited to 1MB of data per option. Database rows that are not automatically loaded are limited to 4MB of data per option.

If your import failed, and you’re unable to deduce why, please contact our support team at WP Engine Support. We are more than happy to help.


NEXT STEP: Review the Migration Process Guide

Still need help? Contact support!

We offer support 24 hours a day, 7 days a week, 365 days a year. Log in to your account to get expert one-on-one help.

The best in WordPress hosting.

See why more customers prefer WP Engine over the competition.