This is a notoriously difficult thing to solve in WordPress because of how the database is constructed. I have since long given up on being able to merge dev -> staging -> prod.
Instead, I track any and all changes I make to the database in my dev environment, manually apply those to the production database when that time comes.
I know it’s not a nice answer, but it’s the only one you’ll get when you need assurances that the DB won’t be borked.
Related Posts:
- How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
- Best way to import users, post and categories from an external database
- Export WP database for import using WP-CLI on Vagrant Box
- MySQL Syntax Error upon restoring database from backup [closed]
- Importing New Posts from Live Site into Local Dev Site
- Export / import WordPress database
- Import users from old WP site to new one
- Best practice to import user base (subscribers) from one website to another?
- Importer fails to import every post
- Is it good practice to import/export a blog to test a redesign?
- I broke database after reuploading local version – what exactly happened? Database error
- Importing Concrete5 content to WordPress
- Why is my database import losing text widget data?
- Multiple developers / editors working on a site in progress
- How can I make updates to a site, on a development copy, but then move updates back without overriding live site’s evolving database?
- Fastest way (least amount of steps) to locally import a remote database using WP-CLI
- Solution for database version control and deployment?
- How to migrate a HTTPS WordPress installation to localhost?
- Migrating data between local and development server
- What’s the database relationship between a post and its attachments
- Syncing local content with development / staging sites
- Organizing WP Pages based on old website database
- Importing posts from old website to new conflicting post ID’s?
- Exporting revisions
- Export wordpress table to excel
- When importing database, it shows error
- Migrating WP site to another URL
- How to migrate a WordPress installation from one site to another, including all images?
- How can I export WordPress posts’ attachments?
- Migrating non-WordPress CMS to WordPress, lots of data to move — possible solutions?
- How to migrate WordPress Blogs into Multisite without using the GUI-Import/Export Feature
- Does WordPress Import/Export tool actually exports media (images) as well?
- Is a direct or import approach safer for migration into WordPress?
- Is it possible to import a wordpress backup from a single site in to a multi-site configuration?
- Weird issue with database migration and SSL links
- How to fix unchanged URLs in Database after running serialized search and replace script?
- Migrating database / content of non-CMS site to WordPress
- How do I reset a self-hosted WordPress URL?
- How much of my site can I recover from public_html?
- I don’t see site_url and home_url fields in wp_options table (phpMyAdmin)?
- Export all content from wordpress
- Import live site to local setup without access to live site
- Migrating WordPress from DreamHost to Azure WordPress Resource via UpdraftPlus “wp_options table does not exist…” error
- Error establishing a database connection; After importing DB & Theme
- Moving minor updates between local and live sites – just database?
- Create a clone from one WordPress site to another in a few minutes
- How to Mirror WordPress database from Remote server to Local server
- Exporting table to csv works in the admin but exports HTML data when used on the front end
- How to move the WordPress site Layout from test site to Production site?
- How do I migrate blog post images from one domain to a new one?
- Why does importing copies of the database dump and the document root make WordPress data inconsistent?
- How can i customize the export personal data file?
- Able to use all admin pages but in the frontend there is a “Error establishing a database connection”-Error
- What is the difference between wp-admin>Export>All content and MySql dump and import
- Export + Import = wrongly duplicated content
- WordPress Local And Live Site
- Copying database tables to new database
- Problems with WordPress Import
- Migrating from PDO using SQLite to clean new install using MySQL
- Migration: Copying database content to a different server
- Connection refused on locahost after importing database?
- Change WordPress URL in sql file via Terminal
- Importing Direct to DB – GUID Question
- How to transform a custom made static HTML website to a WordPress website [closed]
- Strange characters added to the database
- Is there an easy way of exporting posts with their category already asigned and pictures from localhost?
- After database migration, theme mods don’t show [closed]
- Problem migrating to localhost
- WordPress database products structure
- When moving a WordPress installation to a new server, why do I have to update each post before content shows?
- How to transfer from localHost to live but use the already existing database on the server?
- Image link issues after importing a database backup to my local web server
- Database migration issues – Error #1046 No database selected
- product export and import using xml
- echo site_url() returns a different value than what is in the database siteurl field
- How do you do your big exports / imports?
- Bulk Edit Media Library alt, caption, image names
- Migrate Users From laravel to wordpress
- /wp-admin not accessible after migrating to local host (no plugin issue)
- How to fix Uploaded to this post option to see group of images uploaded to a post?
- How do you enable scripts on a WordPress installation in Softaculous?
- WordPress site migration – locked out of admin area
- Malware in old website – how to migrate?
- Exporting Post ID, Post Title, Primary Category and Primary Category ID
- Export only a part of the database for migration
- Exporting Post type from one theme and importing it to another theme
- WP website showing blank page after moving from subdomain to main domain
- WordPress Migration – Issue with admin panel changes
- How to edit posts/pages without making the change live?
- Migrate not successful, DB is broken. How to fix, or at least output static HTML without plugins?
- After Migration From dev, Only my Links to the Homepage Still Redirect to dev
- Restoring .sql backup results in “Error establishing a database connection”
- Migrate bbpress content to posts
- import (migration) user database to wp-users
- Database question while Migrating from one domain to another on same WebHost [Bluehost]
- Moving database from WP 2.6 to 3.5 problem
- export individual posts to text files or a single csv file
- Saving data to database and exporting to excel
- Getting an error when trying to migrate to DV server from Grid with Media Temple [closed]
- Does WordPress import export tool keeps the file hosted on the old website?