After database migration, posts not showing up in dashboard

A great tool for WordPress database and domain migration is Search-Replace-DB. It does all the rename work for you and even takes care of serialized data.

You can find here.

What you should do:

  • Clear the whole database in the target system you fiddled around with.
  • Drop all tables, so that you have an empty database.
  • Re-import the untouched original database from the old domain.
  • Download the three PHP files from SRDB.
    • index.php
    • srdb.class.php
    • srdb.cli.php
  • Upload them in an extra directory in the same folder as your WordPress installation, like ./srdb
    • It should look like:
    • ./srdb
    • ./wp-admin
    • ./wp-content
    • ./…
  • Open it in the browser via http://new-domain.com/srdb

You should see something like this:

Search-Replace-DB

Database credentials should be detected automatically. If not, you put it in the wrong place.

  1. Enter your old domain url
  2. Enter your new domain url
  3. Do a dry run to see if it works.
  4. Do a live run to replace.

Note: This only takes care of the database. If you have domain names hardcoded in your theme files, like CSS, PHP or JS, you have to manually search and replace them.

Hope this helps.