Retain the table prefix of the source site
gathering interest
A
Ashley Graham
It would be great to have an option to retain a custom table prefix. After migrating from Flywheel (custom prefix) to WP Engine (wp_ prefix) we noticed some issues with plugins. I ended up sticking with the wp_ prefix but I had to find/replace references to the old Flywheel prefix manually on the database.
A
Ashley Graham
Hi Kevin
When I created the site on WP Engine I chose the "Migrate a site" option with "Create a new site as the destination for my migrated site". That will have created a fresh WP install that uses the "wp_" prefix.
Should I have chosen the "Replace an existing environment with my migrated site" option?
It has used the "wp_" prefix which is fine. But I found references to the Flywheel prefix in the database when I dowloaded a dump from WP Engine. Those referneces were to do with saving data for AIO, a cookie banner and Bookly plugin. So I had to manually find/replace the Flywheel prefix in the dump and then reimport it to fix this.
Ashley
Kevin Hoffman
Ashley Graham: Thanks for those details. When you choose "Replace an existing environment" the table prefix of the chosen WP Engine environment will be used. In most cases, that prefix will be
wp_
unless you have specifically changed it before attempting the migration. In other words, the migration plugin will always use the current prefix of the destination site.When you did the find and replace, do you happen to know whether the values you had to replace were all contained within the
wp_options
table?A
Ashley Graham
Kevin Hoffman: Instead of an option to retain the prefix then what about an option to overwrite the existing installation. This would solve the issue in my partuclar scenario.
There were values in the wp_options table related to the AIO plugin. We did not have known issues with AIO, I just replaced the values incase.
For the cookie banner and Bookly the references were in tables related to the plugins themselves, not in wp_options.
Kevin Hoffman
gathering interest
In general, changing the table prefix to match the prefix of the destination site is a convenience that saves you from having to edit your wp-config.php file after the migration completes. However, if this behavior is causing issues for your migrations, please share your experience!
Kevin Hoffman
Ashley Graham Thank you for the feedback. I'm the product manager of the WP Engine Site Migration plugin.
To provide some context on this behavior, we change the table prefix for you to make sure the prefix matches the one defined in your wp-config.php file at the destination. By doing so, you don't have to manually edit wp-config.php after the migration to make sure it is pointing to the migrated tables.
I understand this behavior caused some issues for you with certain plugins. I'm curious whether these were custom plugins with hardcoded references to your table prefix. Could you share more about the specific plugins that were affected?