After migration from dev, only my links to the homepage still redirect to dev

by xtian   Last Updated August 20, 2017 00:08 AM

I'm migrating one of my WordPress sites from a development version to the live version. The problem I'm having is with the homepage links.

  • the homepage link in the masthead is redirecting to the dev version.
  • type the homepage URL into the browser, it redirects to dev.
  • click the 'visit site' link in wp-admin, it redirects to dev.

The reasons might be because the migration didn't replace links in the database tables. And! Just to make it more interesting, my first migration failed. So, for a week I redirected the URL in cPanel to the dev version. I've since deleted this redirection, and every page is OK but home.

For a little context, lets say the live site URL is: And the dev site is: That's the same for the server directories: live.x and dev.x. I also used git so I have a repo git.x. There are two databases, tna_x and tna_x_dev.

I've redone the entire migration, including:

  • (on local using vim) verify all the links in the database (download to local, find and replace all URL subdomain instances of dev. with empty string)
  • (cPanel/subdomains) Deleted redirection to
  • (cPanel/Cache Settings) Disable cache for subdomain
  • (WordPress Admin) Verify settings/General reflect the correct URL.
  • (SSH) I searched in WordPress files, grep -R dev, and didn't find anything
  • (phpMyAdmin) I queried the database for dev, and didn't find anything.

If I point my browser to any-non-homepage in, all the links are fine. I can also access wp-admin and add content and do other stuff.

Just to make the question more fun, here is my migration:

  1. (SSH) Worked on the WordPress site files (after last week, I went for the fastest method):
    • deleted the directory live.x.
    • git clone git.x.
    • rename the clone directory from the repo-name x to live.x.
    • verified the file .htaccess was present.
    • Reapplied permissions to folders and directories as required by the server:the
      • find . -type d -exec chmod 755 {} \;
      • find . -type f -exec chmod 644 {} \;
    • Edit WordPress site file, wp-config.php:
      • database: tna_x.
      • database user: tna_x.
      • updated the [password].
  2. (phpMyAdmin) Worked on the site's database:
    • Downloaded the database of dev, tna_x_dev, to my local machine.
  3. (local) Opened this database, and did find and replace for all instances of dev. in the URL.
  4. (phpMyAdmin) Worked on the site's database:
    • Dropped the tables for tna_x.
    • Import the edited tables (from step#3) into tna_x.
    • Verify the python_options table.
  5. (cPanel/MySQL Databases) Verified database for tna_x:
    • has the correct user tna_x.
    • permissions on user tna_x are ALL.
    • checked the database using the "Check Database" tool; scratched my @r$3.
  6. (cPanel/subdomains) Deleted redirection to
  7. (cPanel/Cache Settings) Disable cache for subdomains.

I think that's it. That should be all the settings necessary to update with the contents from BUT, the homepage still redirects to dev...

Tags : migration

Related Questions

Migrating wordpress multisite

Updated June 01, 2015 23:03 PM

Seeking tutorials "How to use Wordpress?"

Updated April 21, 2016 08:03 AM