Conversation
supportHi We have a staging website that’s been recently setup and i’m trying to use your plugin’s Find & Replace tool to replace all of the existing Live domain URLs with the correct Test website domain. It seems these are via ACF Link fields and mostly seem to come from the wp_options table. So i’ve targeted this specific table and your plugin gives me this overview: Table wp_options Matches Found 120 Time 1.13 secs But when i try to apply the changes we’re getting an immediate error. Looking in my logs I’m getting these errors: 2026/02/27 13:41:29 [error] 4134510#4134510: *78600 FastCGI sent in stderr: "PHP message: WordPress database error Column 'option_id' cannot be null for query INSERT INTO _mig_wp_options ( option_id , option_name , option_value , autoload ) VALUES ( NULL , 'wpmdb_settings', 'a:14:{s:3:\"key\";s:40:\"8KjUFkyEidfSDc31Pnx8OlP/n90Q6MFSQWqNCAMZ\";s:10:\"allow_pull\";b:0;s:10:\"allow_push\";b:0;s:8:\"profiles\";a:0:{}s:7:\"licence\";s:0:\"\";s:10:\"verify_ssl\";b:0;s:17:\"whitelist_plugins\";a:0:{}s:11:\"max_request\";i:1048576;s:22:\"delay_between_requests\";i:0;s:18:\"prog_tables_hidden\";b:1;s:21:\"pause_before_finalize\";b:0;s:14:\"allow_tracking\";N;s:26:\"high_performance_transfers\";b:0;s:18:\"compatibility_mode\";b:1;}', 'off' ) made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, DeliciousBrains\WPMDB\Common\Migration\FinalizeMigration->ajax_finalize_migra...; PHP message: WordPress database error Column 'option_id' cannot be null for query INSERT INTO _mig_wp_options ( option_id , option_name , option_value , autoload ) VALUES ( NULL , 'wpmdb_saved_profiles', '', 'off' ) made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, DeliciousBrains\WPMDB\Common\Migration\FinalizeMigration->ajax_finalize_migration, DeliciousBrains\WPMDB\Common\Migration\FinalizeMigration->finalize_migration, DeliciousBrains\WPMDB\Common\Sql\Table->process_chunk; PHP message: WordPress database error Column 'option_id' cannot be null for query INSERT INTO _mig_wp_options ( option_id , option_name , option_value , autoload ) VALUES ( NULL , 'wpmdb_recent_mi 2026/02/27 13:41:29 [error] 4134510#4134510: *78600 FastCGI sent in stderr: "; PHP message: WordPress database error Column 'option_id' cannot be null for query INSERT INTO _mig_wp_options ( option_id , option_name , option_value , autoload ) VALUES ( NULL , 'wpmdb_remote_migration_state', '', 'off' ) made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, DeliciousBrains\WPMDB\Common\Migration\FinalizeMigration->ajax_finalize_migration, DeliciousBrains\WPMDB\Common\Migration\FinalizeMigration->finalize_migration, DeliciousBrains\WPMDB\Common\Sql\Table->process_chunk" while reading upstream, client: 62.223.232.68, server: {SITE_URL}, request: "POST /wp-json/mdb-api/v1/finalize-migration HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm-{SITE}.sock:", host: "{SITE_URL}", referrer: "https://{SITE_URL}/wp-admin/tools.php?page=wp-migrate-db" 2026/02/27 13:41:29 [error] 4134510#4134510: *78600 FastCGI sent in stderr: "; PHP message: WordPress database error Column 'option_id' cannot be null for query INSERT INTO _mig_wp_options ( option_id , option_name , option_value , autoload ) VALUES ( NULL , 'wpmdb_schema_version', '3.6', 'off' ) made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, DeliciousBrains\WPMDB\Common\Migration\FinalizeMigration->ajax_finalize_migration, DeliciousBrains\WPMDB\Common\Migration\FinalizeMigration->finalize_migration, DeliciousBrains\WPMDB\Common\Sql\Table->process_chunk" while reading upstream, client: 62.223.232.68, server: {SITE_URL}, request: "POST /wp-json/mdb-api/v1/finalize-migration HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm-{SITE}.sock:", host: "{SITE_URL}", referrer: "https://{SITE_URL}/wp-admin/tools.php?page=wp-migrate-db" 2026/02/27 13:41:29 [error] 4134510#4134510: *78600 FastCGI sent in stderr: "; PHP message: WordPress database error Column 'option_id' cannot be null for query INSERT INTO _mig_wp_options ( option_id , option_name , option_value , autoload ) VALUES ( NULL , 'wpmdb_migration_state', 'a:25:{s:6:\"intent\";s:12:\"find_replace\";s:9:\"form_data\";s:1210:\"{\"current_migration\":{\"connected\":false,\"intent\":\"find_replace\",\"tables_option\":\"selected\",\"tables_selected\":[\"wp_options\"],\"backup_option\":\"none\",\"backup_tables_selected\":[],\"post_types_option\":\"all\",\"post_types_selected\":[],\"advanced_options_selected\":[\"replace_guids\",\"exclude_transients\"],\"profile_name\":\"Find & Replace\",\"selected_existing_profile\":null,\"profile_type\":null,\"status\":\"\",\"stages\":[\"tables\"],\"current_stage\":\"find_replace\",\"stages_complete\":[],\"running\":true,\"migration_enabled\":true,\"migration_id\":\"023dca93-987c-42b4-8e48-bcc8c1e48189\",\"source_prefix\":\"\",\"destination_prefix\":\"\",\"preview\":" while reading upstream, client: 62.223.232.68, server: {SITE_URL}, request: "POST /wp-json/mdb-api/v1/finalize-migration HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm-{SITE}.sock:", host: "{SITE_URL}", referrer: "https://{SITE_URL}/wp-admin/tools.php?page=wp-migrate-db" 2026/02/27 13:41:29 [error] 4134510#4134510: *78600 FastCGI sent in stderr: "true,\"selectedComboOption\":\"preview\",\"two" while reading upstream, client: 62.223.232.68, server: {SITE_URL}, request: "POST /wp-json/mdb-api/v1/finalize-migration HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm-{SITE}.sock:", host: "{SITE_URL}", referrer: "https://{SITE_URL}/wp-admin/tools.php?page=wp-migrate-db" 2026/02/27 13:41:29 [error] 4134510#4134510: *78600 FastCGI sent in stderr: "; PHP message: WordPress database error Column 'option_id' cannot be null for query INSERT INTO _mig_wp_options ( option_id , option_name , option_value , autoload ) VALUES ( NULL , 'wpmdb_migration_options', 'a:17:{s:17:\"current_migration\";a:33:{s:9:\"connected\";b:0;s:6:\"intent\";s:12:\"find_replace\";s:13:\"tables_option\";s:8:\"selected\";s:15:\"tables_selected\";a:1:{i:0;s:10:\"wp_options\";}s:13:\"backup_option\";s:4:\"none\";s:22:\"backup_tables_selected\";a:0:{}s:17:\"post_types_option\";s:3:\"all\";s:19:\"post_types_selected\";a:0:{}s:25:\"advanced_options_selected\";a:2:{i:0;s:13:\"replace_guids\";i:1;s:18:\"exclude_transients\";}s:12:\"profile_name\";s:14:\"Find & Replace\";s:25:\"selected_existing_profile\";N;s:12:\"profile_type\";N;s:6:\"status\";s:0:\"\";s:6:\"stages\";a:1:{i:0;s:6:\"tables\";}s:13:\"current_stage\";s:12:\"find_replace\";s:15:\"stages_complete\";a:0:{}s:7:\"running\";b:1;s:17:\"migration_enabled\";b:1;s:12:\"migration_id\";s:36:\"023dca93-987c-42b4-8e48-bcc8c" while reading upstream, client: 62.223.232.68, server: {SITE_URL}, request: "POST /wp-json/mdb-api/v1/finalize-migration HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm-{SITE}.sock:", host: "{SITE_URL}", referrer: "https://{SITE_URL}/wp-admin/tools.php?page=wp-migrate-db" 2026/02/27 13:41:29 [error] 4134510#4134510: *78600 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined array key "form_data" in /home/{FOLDER}/{SITE_URL}/wp-content/plugins/wp-migrate-db/class/Common/Migration/MigrationManager.php on line 457; PHP message: PHP Fatal error: Uncaught TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given in /home/{FOLDER}/{SITE_URL}/wp-content/plugins/wp-migrate-db/class/Common/FormData/FormData.php:175 Stack trace: #0 /home/{FOLDER}/{SITE_URL}/wp-content/plugins/wp-migrate-db/class/Common/FormData/FormData.php(175): array_intersect_key() #1 /home/{FOLDER}/{SITE_URL}/wp-content/plugins/wp-migrate-db/class/Common/Migration/MigrationManager.php(457): DeliciousBrains\WPMDB\Common\FormData\FormData->parse_and_save_migration_form_data() #2 /home/{FOLDER}/{SITE_URL}/wp-content/plugins/wp-migrate-db/class/Common/Migration/MigrationManager.php(437): DeliciousBrains\WPMDB\Common\Migration\MigrationManager->ajax_cancel_migration() #3 /home/{FOLDER}/{SITE_URL}/wp-includes/rest-api/class-wp-rest-server.php(1292): DeliciousBrains\WPMDB\Common\Migration\MigrationManager->error_migration" while reading response header from upstream, client: 62.223.232.68, server: {SITE_URL}, request: "POST /wp-json/mdb-api/v1/error-migration HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm-{SITE}.sock:", host: "{SITE_URL}", referrer: "https://{SITE_URL}/wp-admin/tools.php?page=wp-migrate-db" I’ve replace some of the above with placeholders: {SITE} {FOLDER} {SITE_URL} Looking at my database it doesn’t look like the table mig_wp_options even exists? So not really sure why it’s trying to insert into it? I’m using the latest version of your plugin and WordPress Version 6.8.3 Any solutions / recommendations? Thanks The page I need help with: [ log in to see the link]
Hi @kurtnuimage ! WP Migrate Support Team here. Thanks for reaching out with your query! We would be happy to assist. _mig_wp_options is a temporary table WP Migrate creates used in migration. It is a copy of your site’s wp_options. Could you check for us if your site’s wp_options table has a primary key (option_id) and does option_id have AUTO_INCREMENT enabled? Adding those settings to the wp_options table should help with the issue. Let us know how it goes!
Hi There! Thanks for coming back to me! I checked my database table for the test website and it was indeed missing the AUTO_INCREMENT and PRIMARY key constraints. I’m not too sure why as it should have been a copy of the live database but I’ve updated those values and given it a re-test. The Find / Replace tools have now worked perfectly so thank you for the help!
Hi @kurtnuimage ! WP Migrate Support Team here. Thanks for reaching out with your query! We would be happy to assist. _mig_wp_options is a temporary table WP Migrate creates used in migration. It is a copy of your site’s wp_options. Could you check for us if your site’s wp_options table has a primary key (option_id) and does option_id have AUTO_INCREMENT enabled? Adding those settings to the wp_options table should help with the issue. Let us know how it goes!
Hi There! Thanks for coming back to me! I checked my database table for the test website and it was indeed missing the AUTO_INCREMENT and PRIMARY key constraints. I’m not too sure why as it should have been a copy of the live database but I’ve updated those values and given it a re-test. The Find / Replace tools have now worked perfectly so thank you for the help!