Menu

Import a database to production/staging site

Updated on February 21st, 2023

Flywheel’s Database Manager allows you to import a single WordPress database in .sql format to your production or staging site. Learn more about Database Manager.

This guide will walk you through the import process as well as provide some post-import tips to help ensure your new database plays nicely with your WordPress install.



How to import a database to production

  1. We suggest making a new backup before making any database changes to your production site.
  2. From the Sites page, click on the appropriate site.
  3. Navigate to the site’s Advanced tab.
  4. On the Database card in the right sidebar, click the Manage Database button to open Flywheel’s Database Manager.
  5. Select the Import tab.
  6. Click Choose File and browse your computer for the database file (must be .sql format and 50mb or less).
  7. Click the Import File to upload the database to your production site.
  8. If necessary, update the database prefix on Flywheel for your production site.
  9. If necessary, update domains and links to the primary domain.

How to import a database to staging

  1. Flywheel doesn’t offer backups for staging sites at this time, but if you’re concerned about losing data, we suggest backing up your staging database using a plugin such as WP Migrate.
  2. From the Sites page, click on the appropriate site.
  3. Navigate to the site’s Staging tab. (If you don’t see it, make sure staging is enabled.)
  4. On the Database card in the right sidebar, click the Manage Database button to open Flywheel’s Database Manager.
  5. Select the Import tab.
  6. Click Choose File and browse your computer for the database file (must be .sql format and 50mb or less).
  7. Click Import File to import the database to your staging site.
  8. If necessary, update the database prefix on Flywheel for your staging site.
  9. If necessary, update domains and links to the staging domain.

If necessary, update the database prefix

Your production site’s prefix can be configured from the Advanced tab of the site’s Flywheel dashboard on the Database card. This value should match the database’s actual prefix.

Note

Staging sites always inherit the database prefix of the production site and can’t be altered.
  1. To confirm your database’s actual prefix, click Manage Database.
  2. Enter the term “users” in the search bar. This will bring up the users table, which is a trustworthy indicator of the database’s prefix.
  3. The database prefix is an identical string of characters at the beginning of every single table name in your database. The default is “wp_” but frequently varies. Prefixes almost always end with an underscore. In this example, the database prefix is “wp_”.
  4. If the prefix value on your site’s Database card differs, you can update it.
  5. Hover over the Database card to reveal the 3-dot menu icon next to the prefix, and click Change.
  6. Enter the database’s actual prefix and click Change Prefix.

Note

Depending on how the original site was built and how it stores its data in the database, this step may not be necessary.

Often, the domain which was being used to build the original site will still remain in the database after it’s imported to Flywheel. If this doesn’t match the domain set as primary (or staging) on Flywheel, the site may not load correctly.

You can easily run a search-and-replace for the domain by using a plugin like Better Search Replace, or by using SQL commands inside the Database Manager. Otherwise, feel free to reach out to Flywheel Support to help with a search-and-replace.


Need help?

If you have any questions our Happiness Engineers are here to help!

Was this article helpful?

Getting Started

New to Flywheel? Start here, we've got all the information you'll need to get started and launch your first site!

View all

Account Management

Learn all about managing your Flywheel user account, Teams and integrations.

View all

Billing

Everything about billing, invoices and payments can be found here.

View all

Features

Flywheel hosting plans include a ton of great features. Learn about how to get a free SSL certificate, set up a staging site, and more!

View all

Platform Info

All the server and setting info you'll need to help you get the most out of your Flywheel hosting plan!

View all

Site Management

Tips and tricks for managing your sites on Flywheel, including going live, troubleshooting issues and migrating or cloning sites.

View all

Developer Hub

Learn how to connect, deploy, and more with SSH on Flywheel's platform.

View all

Growth Suite

Learn more about Growth Suite, our all-in-one solution for freelancers and agencies to grow more quickly and predictably.

View all

Managed Plugin Updates

Learn more about Managed Plugin Updates, and how you can keep your sites up to date, and extra safe.

View all

 

Flywheel help

Help is just a click away! Log into Flywheel dashboard to instantly chat with an expert, respond to a ticket, or follow along with in-depth documentation. We happily offer support 24 hours a day, 7 days a week, 365 days a year!

Log in

Try Flywheel today

Launch your next WordPress site in minutes.

 Free migrations  24/7/365 support  14 day demo sites