Database merging/reversion

I have a site I built locally and migrated to a live environment. Later I created a copy of this site and booted it up locally again to do some further dev in there. Local created a fresh DB for the site to run from at this point.

I am now ready to push to production with the new version, and am finding that on uploading the database to the live server, the prefix on all DB tables which existed before (including the home and site_url values) is reverting to an old sequence, and fetching values from the previous database. These should read ‘[site_name].local’ for the local install, but they do not.

Where new tables have been created (e.g. with the addition of a plugin), the prefix is as I expect it to be.

If I open the database in Sequel Pro, I see the prefixes and values I expect to see – they are correct and they match the contents of the site. However if I open it in Adminer I see the older values, as when I import the DB to the server using PHPMyAdmin.

The only way I have managed to get the production site to work is by manually setting the home and site_url values in wp_config.php as per this article: This feels hacky to me, and not future-proof.

I will have more dev to do in this site over the coming months – I would like to stabilise this issue and get it working like every other WP install I have created, but I cannot figure out what is happening here.

This happens for just one site.

I don’t know how it could be replicated.

I am able to create new sites fine. This is an issue with the imported database.

Local Version 5.1.0+5403
MacOS Big Sur 11.4

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.