Support » Plugin: MultiSite Clone Duplicator » Dont clone WooCommerce table

  • The plugin is not cloning the WooCommerce tables, the others are ok.

    tdhp_11_woocommerce_sessions Esta tabela não existe
    tdhp_11_woocommerce_api_keys Esta tabela não existe
    tdhp_11_woocommerce_attribute_taxonomies Esta tabela não existe
    tdhp_11_woocommerce_downloadable_product_permissions Esta tabela não existe
    tdhp_11_woocommerce_order_items Esta tabela não existe
    tdhp_11_woocommerce_order_itemmeta Esta tabela não existe
    tdhp_11_woocommerce_tax_rates Esta tabela não existe
    tdhp_11_woocommerce_tax_rate_locations Esta tabela não existe
    tdhp_11_woocommerce_shipping_zones Esta tabela não existe
    tdhp_11_woocommerce_shipping_zone_locations Esta tabela não existe
    tdhp_11_woocommerce_shipping_zone_methods Esta tabela não existe
    tdhp_11_woocommerce_payment_tokens Esta tabela não existe
    tdhp_11_woocommerce_payment_tokenmeta Esta tabela não existe
    tdhp_11_woocommerce_log Esta tabela não existe

Viewing 3 replies - 1 through 3 (of 3 total)
  • patrickarsenalweb

    (@patrickarsenalweb)

    Hi, I had the same problem. I had to edit the plugin’s file to make it work.

    In wp-content\plugins\multisite-clone-duplicator\include\option.php, update the following methods:

    
    public static function get_default_fields_to_update() {
        return array (
            'commentmeta' => array(),
            'comments' => array(),
            'links' => array('link_url', 'link_image'),
            'options' => array('option_name', 'option_value'),
            'postmeta' => array('meta_value'),
            'posts' => array('post_content', 'guid'),
            'terms' => array(),
            'term_relationships' => array(),
            'term_taxonomy' => array(),
            'wc_download_log' => array(),
            'wc_webhooks' => array(),
            'woocommerce_api_keys' => array(),
            'woocommerce_attribute_taxonomies' => array(),
            'woocommerce_downloadable_product_permissions' => array(),
            'woocommerce_log' => array(),
            'woocommerce_order_itemmeta' => array(),
            'woocommerce_order_items' => array(),
            'woocommerce_payment_tokenmeta' => array(),
            'woocommerce_payment_tokens' => array(),
            'woocommerce_sessions' => array(),
            'woocommerce_shipping_zones' => array(),
            'woocommerce_shipping_zone_locations' => array(),
            'woocommerce_shipping_zone_methods' => array(),
            'woocommerce_tax_rates' => array(),
            'woocommerce_tax_rate_locations' => array(),
        );
    }
    

    and

    
    public static function get_default_primary_tables_to_copy() {
        return array (
            'commentmeta',
            'comments',
            'links',
            'options',
            'postmeta',
            'posts',
            'terms',
            'term_relationships',
            'term_taxonomy',
            'termmeta',
            'wc_download_log',
            'wc_webhooks',
            'woocommerce_api_keys',
            'woocommerce_attribute_taxonomies',
            'woocommerce_downloadable_product_permissions',
            'woocommerce_log',
            'woocommerce_order_itemmeta',
            'woocommerce_order_items',
            'woocommerce_payment_tokenmeta',
            'woocommerce_payment_tokens',
            'woocommerce_sessions',
            'woocommerce_shipping_zones',
            'woocommerce_shipping_zone_locations',
            'woocommerce_shipping_zone_methods',
            'woocommerce_tax_rates',
            'woocommerce_tax_rate_locations',
        );
    }
    

    Then, all of WooCommerce tables will be copied!

    Plugin Author David Daugreilh

    (@daviddaug)

    Hello,

    Woocommerce tables are not in the default tables from wordpress database, and have to be declared to be used with Multisite Clone Duplicator.

    In your functions.php, add this filter :

    
    function mucd_primary_table_to_copy($primary_tables) {
        $primary_tables[] = 'woocommerce_api_keys';
        $primary_tables[] = 'woocommerce_attribute_taxonomies';
        $primary_tables[] = 'woocommerce_downloadable_product_permissions';
        $primary_tables[] = 'woocommerce_log';
        $primary_tables[] = 'woocommerce_order_itemmeta';
        $primary_tables[] = 'woocommerce_order_items';
        $primary_tables[] = 'woocommerce_payment_tokenmeta';
        $primary_tables[] = 'woocommerce_payment_tokens';
        $primary_tables[] = 'woocommerce_sessions';
        $primary_tables[] = 'woocommerce_shipping_zones';
        $primary_tables[] = 'woocommerce_shipping_zone_locations';
        $primary_tables[] = 'woocommerce_shipping_zone_methods';
        $primary_tables[] = 'woocommerce_tax_rates';
        $primary_tables[] = 'woocommerce_tax_rate_locations';
        return $primary_tables;
    }
    add_filter('mucd_default_primary_tables_to_copy', 'mucd_primary_table_to_copy');
    

    Regards,
    David

    Hi David,
    Does your comment about adding the filter for woocommerce tables still stand or has the plugin been revised to address this when cloning multisite WC site?
    Thanks,
    Paul

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Dont clone WooCommerce table’ is closed to new replies.