Skip to content

Import a site to blog_id= 2 ERROR 1050 (42S01) at line 25 Table 'wp_comments' already exists #101

@Olya-Tom

Description

@Olya-Tom

Describe the bug

when importing a site with the option blog_id=2, error
Importing tables...
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
ERROR 1050 (42S01) at line 88 in file: 'mu-migration1669237386/mu-migration-1090416661oneadvocate-eu.sql': Table 'wp_commentmeta' already exists

when importing without blog_id, but with the option add_new_url=domain/single, another error

Extracting zip package... WordPress database error Table 'root.wp_3_options' doesn't exist for query SELECT option_value FROM wp_3_options WHERE option_name = 'wp_3_user_roles' LIMIT 1 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, TenUp\MU_Migration\Commands\ImportCommand->all, TenUp\MU_Migration\Commands\ImportCommand->create_new_site, insert_blog, wp_insert_site, do_action('wp_insert_site'), WP_Hook->do_action, WP_Hook->apply_filters, PLL_Install_Base->new_site, switch_to_blog, do_action('switch_blog'), WP_Hook->do_action, WP_Hook->apply_filters, wp_switch_roles_and_user, WP_Roles->for_site, WP_Roles->get_roles_data, get_option WordPress database error Table 'root.wp_3_options' doesn't exist for query SELECT option_value FROM wp_3_options WHERE option_name = 'active_plugins' LIMIT 1 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, TenUp\MU_Migration\Commands\ImportCommand->all, TenUp\MU_Migration\Commands\ImportCommand->create_new_site, insert_blog, wp_insert_site, do_action('wp_insert_site'), WP_Hook->do_action, WP_Hook->apply_filters, PLL_Install_Base->new_site, switch_to_blog, do_action('switch_blog'), WP_Hook->do_action, WP_Hook->apply_filters, PLL_Base->switch_blog, PLL_Base->is_active_on_new_blog, get_option WordPress database error Table 'root.wp_3_options' doesn't exist for query SELECT option_value FROM wp_3_options WHERE option_name = 'polylang' LIMIT 1 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, TenUp\MU_Migration\Commands\ImportCommand->all, TenUp\MU_Migration\Commands\ImportCommand->create_new_site, insert_blog, wp_insert_site, do_action('wp_insert_site'), WP_Hook->do_action, WP_Hook->apply_filters, PLL_Install_Base->new_site, PLL_Install->_activate, get_option WordPress database error Table 'root.wp_3_options' doesn't exist for query INSERT INTO wp_3_options (option_name, option_value, autoload) VALUES ('polylang', 'a:13:{s:7:\"browser\";i:0;s:7:\"rewrite\";i:1;s:12:\"hide_default\";i:1;s:10:\"force_lang\";i:1;s:13:\"redirect_lang\";i:0;s:13:\"media_support\";i:0;s:9:\"uninstall\";i:0;s:4:\"sync\";a:0:{}s:10:\"post_types\";a:0:{}s:10:\"taxonomies\";a:0:{}s:7:\"domains\";a:0:{}s:7:\"version\";s:5:\"3.2.8\";s:16:\"first_activation\";i:1669239061;}', 'yes') ON DUPLICATE KEY UPDATE option_name = VALUES(option_name), option_value = VALUES(option_value), autoload = VALUES(autoload) 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, TenUp\MU_Migration\Commands\ImportCommand->all, TenUp\MU_Migration\Commands\ImportCommand->create_new_site, insert_blog, wp_insert_site, do_action('wp_insert_site'), WP_Hook->do_action, WP_Hook->apply_filters, PLL_Install_Base->new_site, PLL_Install->_activate, update_option, add_option WordPress database error Table 'root.wp_3_options' doesn't exist for query SELECT option_value FROM wp_3_options WHERE option_name = 'polylang_wpml_strings' LIMIT 1 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, TenUp\MU_Migration\Commands\ImportCommand->all, TenUp\MU_Migration\Commands\ImportCommand->create_new_site, insert_blog, wp_insert_site, do_action('wp_insert_site'), WP_Hook->do_action, WP_Hook->apply_filters, PLL_Install_Base->new_site, PLL_Install->_activate, get_option WordPress database error Table 'root.wp_3_options' doesn't exist for query INSERT INTO wp_3_options (option_name, option_value, autoload) VALUES ('polylang_wpml_strings', 'a:0:{}', 'yes') ON DUPLICATE KEY UPDATE option_name = VALUES(option_name), option_value = VALUES(option_value), autoload = VALUES(autoload) 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, TenUp\MU_Migration\Commands\ImportCommand->all, TenUp\MU_Migration\Commands\ImportCommand->create_new_site, insert_blog, wp_insert_site, do_action('wp_insert_site'), WP_Hook->do_action, WP_Hook->apply_filters, PLL_Install_Base->new_site, PLL_Install->_activate, update_option, add_option WordPress database error Table 'root.wp_3_options' doesn't exist for query SELECT autoload FROM wp_3_options WHERE option_name = 'rewrite_rules' 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, TenUp\MU_Migration\Commands\ImportCommand->all, TenUp\MU_Migration\Commands\ImportCommand->create_new_site, insert_blog, wp_insert_site, do_action('wp_insert_site'), WP_Hook->do_action, WP_Hook->apply_filters, PLL_Install_Base->new_site, PLL_Install->_activate, delete_option
Importing tables...
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed

when importing a site with the option blog_id=1, everything works

Extracting zip package...
Importing tables...
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Warning: Something went wrong while running sed
Moving files...
Importing Users...
[3124] Updating posts authors 100%[======================================================================] 0:54 / 0:54Flushing rewrite rules...
Removing temporary files....
Success: All done, your new site is available at http://test.local. Remember to flush the cache (memcache, redis etc).

Steps to Reproduce

  1. I tried deleting tables from the database, but after wp_commentmta, the error points to wp_comment, wp_links and so on
  2. The content of the site is not important, I tried different sites, including creating one entry on a clean site, exporting and then importing

`

Screenshots, screen recording, code snippet

wsl_oPAVDfcl2T

Environment information

I am using windows 10, with WSL 1 Ubuntu,
Server version: Apache/2.4.41 (Ubuntu)
PHP 7.4.3,
MySQL Ver 8.0.31-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)),
WP-CLI 2.7.1

WordPress information

Wordpress 6.1.1

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions