Knowledgebase

Recovering a Single Deleted Row Print

  • databasesphpmyadmin, databases, database, backup, restore, woocommerce, wordpress, phpmyadmin, errors
  • 0

Getting one record back.

THE SITUATION

One post, one order, one customer deleted in error. The rest of the database is current and correct.

WHAT NOT TO DO

Restore the whole database. That loses everything since the backup to recover one row.

THE CORRECT APPROACH

  1. Create a temporary database.
  2. Import your backup into it.
  3. Find the row you need.
  4. Copy it into the live database.
  5. Remove the temporary database.

FINDING IT

Browse or search the relevant table in the temporary database.

COPYING IT

phpMyAdmin can export a single row as an INSERT statement. Run that against the live database.

Check first that the id is not already in use.

THE RELATED DATA

Content rarely lives in one row. A post has metadata, term relationships and possibly comments.

Recover those too, or the restored row is incomplete.

For WordPress, the post row plus its postmeta rows plus its term relationships.

CHECKING THE APPLICATION'S TRASH FIRST

Many applications keep deleted items for a period. Check there before anything else.


Was this answer helpful?
Back

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


Trustpilot