deliciousbrains / wp-migrate-db

WordPress plugin that exports your database, does a find and replace on URLs and file paths, then allows you to save it to your computer.
https://wordpress.org/plugins/wp-migrate-db/
341 stars 515 forks source link

wpmdb_settings are not properly migrated #109

Closed QuietNoise closed 2 years ago

QuietNoise commented 4 years ago

Hi, Usually when I work on the WP site I migrate/sync db back and forth between dev, staging and live site. I've noticed a rather frustrating behaviour of the plugin. It doesn't migrate it's own settings making all the migration profiles getting lost after migration. I've found a workaround by manually copying the wpmdb_settings row from source wp_options table to destination one. However, I would rather have the wpmdb_settings to be part of the migration if possible.

axelf commented 3 years ago

I noticed this problem today and hope this will be fixed soon.

kevinwhoffman commented 2 years ago

Hi there, I know this was posted some time ago, but I wanted to follow up and clarify that the following WP Migrate DB options are excluded from migrations. Specifically, wpmdb_saved_profiles contain the migration profiles that you are referring to.

This is by design, because different migration profiles in different environments will require different connection info. Therefore we need to preserve the profiles of the destination site in order to ensure they continue working after the migration.

https://github.com/deliciousbrains/wp-migrate-db/blob/97a7b6299ae5c977e8879822ae7253a86b2fa65d/class/Common/Sql/Table.php#L1263-L1282

As you may notice in the code above, these options are included when exporting the database. So if you want to ensure that you the current WP Migrate DB options get carried over into the new environment, you may want to consider an export/import flow instead.