Knowledgebase

Cloning a Database for Staging Print

  • databasesphpmyadmin, databases, staging, database, email, billing, redirects, guide
  • 0

Making a copy to work on.

WHY

Testing updates, changes or development against real data without risking the live site.

THE PROCEDURE

  1. Export the live database.
  2. Create a new database and user for staging.
  3. Import the dump into it.
  4. Point the staging site's configuration at the new database.
  5. Update the site URL in the staging database to the staging address.

THE STEP PEOPLE MISS

Updating the URL. Without it, the staging site redirects to the live site and you end up editing production while believing you are on staging.

Run a search and replace for the URL immediately after importing.

WHAT ELSE TO CHANGE ON STAGING

Disable outgoing email, or test messages reach real customers Disable payment gateways, or set them to test mode Set search engines to discourage indexing Protect the staging site with Directory Privacy

KEEPING IT CURRENT

A staging copy from six months ago tests very little. Refresh it before significant work.

AFTERWARDS

Never push a staging database to a live site with real data. You overwrite every order and registration since the copy.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot