M
M
Maxim2021-01-15 14:31:54
WordPress
Maxim, 2021-01-15 14:31:54

How to move products to a separate WP table?

Good afternoon.

With the store, we started having problems with the site loading speed in general in Yandex.Webmaster, there is a constant error that the site loads less, and I decided to try to transfer the goods to a separate table. I found an article: https://developer.woocommerce.com/2018/07/17 /wooco...
but when executing the command that is there

wp wc-product-tables migrate-data [--clean-old-data]

Gives an error message

База данных WordPress возвратила ошибку Unknown table 'USER.wp_wc_products' в ответ на запрос DROP TABLE wp_wc_products, wp_wc_product_downloads, wp_wc_product_attributes, wp_wc_product_relationships, wp_wc_product_attribute_values, wp_wc_product_variation_attribute_values, выполненный include('phar:///usr/local/bin/wp/php/boot-phar.php'), include('phar:///usr/local/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, WC_Product_Tables_Cli->recreate_tables
База данных WordPress возвратила ошибку You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'virtual (virtual),
KEY downloadable (downloadable),
KEY stock_status (' at line 26 в ответ на запрос
CREATE TABLE wp_wc_products (
`product_id` bigint(20) NOT NULL,
`sku` varchar(100) NULL default '',
`image_id` bigint(20) NULL default 0,
`height` double NULL default NULL,
`width` double NULL default NULL,
`length` double NULL default NULL,
`weight` double NULL default NULL,
`stock_quantity` double NULL default NULL,
`type` varchar(100) NULL default 'simple',
`virtual` tinyint(1) NULL default 0,
`downloadable` tinyint(1) NULL default 0,
`tax_class` varchar(100) NULL default '',
`tax_status` varchar(100) NULL default 'taxable',
`total_sales` double NULL default 0,
`price` double NULL default NULL,
`regular_price` double NULL default NULL,
`sale_price` double NULL default NULL,
`date_on_sale_from` datetime NULL default NULL,
`date_on_sale_to` datetime NULL default NULL,
`average_rating` float NULL default 0,
`stock_status` varchar(100) NULL default 'instock',
PRIMARY KEY  (`product_id`),
KEY image_id (image_id),
KEY type (type),
KEY virtual (virtual),
KEY downloadable (downloadable),
KEY stock_status (stock_status)

) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci, выполненный include('phar:///usr/local/bin/wp/php/boot-phar.php'), include('phar:///usr/local/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, WC_Product_Tables_Cli->recreate_tables, WC_Product_Tables_Install::activate, dbDelta


Maybe someone faced this problem?

WP 5.6
WooCommerce 4.9.0

WP-CLI run under php 7.2

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question