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

Compatibility issue with DigitalOcean Managed Databases #113

Open sangemaru opened 3 years ago

sangemaru commented 3 years ago

This is a MySQL 8.0-specific issue. When running a migration using wp migratedb in the command-line, we're seeing the following errors crop up:

WordPress database error Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting. for query CREATE TABLE_mig_wpmdb_alter_statements(queryLONGTEXT NOT NULL ) made by include('phar:///usr/bin/wp/php/boot-phar.php'), include('phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php'), WP_CLI\bootstrap, WP_CLI\Bootstrap\LaunchRunner->process, WP_CLI\Runner->start, WP_CLI\Runner->run_command_and_exit, WP_CLI\Runner->run_command, WP_CLI\Dispatcher\Subcommand->invoke, call_user_func, WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}, call_user_func, DeliciousBrains\WPMDBCli\Command->pull, DeliciousBrains\WPMDBCli\Command->_perform_cli_migration, DeliciousBrains\WPMDB\Common\Cli\Cli->cli_migration, DeliciousBrains\WPMDB\Common\Cli\Cli->cli_initiate_migration, DeliciousBrains\WPMDB\Common\Cli\Cli->initiate_migration, DeliciousBrains\WPMDB\Common\Migration\InitiateMigration->ajax_initiate_migration, DeliciousBrains\WPMDB\Common\Sql\Table->process_chunk

It looks like the software is not accounting for and creating primary keys where necessary.

polevaultweb commented 3 years ago

Thanks @sangemaru, added to our internal issue tracker 👍