One thing that I would like to support is migrating from WooCommerce into Drupal Commerce. There are two possible ways this would happen

  • Direct database migration from WordPress to Drupal
  • WordPress XML exports

As pointed out on Twitter (https://twitter.com/daggerhart/status/861416550099820545), WooCommerce provides dummy data imports on https://docs.woocommerce.com/document/importing-woocommerce-dummy-data/.

The first way forward is to export a WooCommerce site with the imported data using the db-tools.php script. Get tests going, and rock that out.

A follow up would be great to provide an XML source plugin (from https://www.drupal.org/project/migrate_plus) to migrate WooCommerce. However that might fall into the large WP -> Drupal scope.

CommentFileSizeAuthor
#2 2876446-2.patch992.63 KBquietone
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mglaman created an issue. See original summary.

quietone’s picture

Parent issue: » #2893000: [Meta] Woocommerce
FileSize
992.63 KB

Made a test fixture using the woocommerce dummy data and put in a new module.

mglaman’s picture

Status: Active » Fixed

Woo! Excited to see this get started. I wonder, though, if we might end up running into duplicate efforts with generic WordPress migration (everything is posts)

quietone’s picture

Status: Fixed » Needs work

Unfortunately this fixture doesn't load

  [Drupal\Core\Database\DatabaseExceptionWrapper]                                                                                       
  SQLSTATE[42000]: Syntax error or access violation: 1115 Unknown character set: 'utf8mb4_unicode_ci': CREATE TABLE {wp_commentmeta} (  
  `meta_id` BIGINT unsigned NOT NULL auto_increment,                                                                                    
  `comment_id` BIGINT unsigned NOT NULL DEFAULT '0',                                                                                    
  `meta_key` VARCHAR(255) NULL DEFAULT NULL,                                                                                            
  `meta_value` LONGTEXT NULL DEFAULT NULL,                                                                                              
  PRIMARY KEY (`meta_id`),                                                                                                              
  INDEX `comment_id` (`comment_id`),                                                                                                    
  INDEX `meta_key` (`meta_key`(191))                                                                                                    
  ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4_unicode_ci; Array                                                                     
  (                                                                                                                                     
  )          
quietone’s picture

Both the Woocommerce and the magento test fixture fail to load in the usual way. That is, they were created in the same way as the Drupal 6 and 7 test fixtures in core. And that is the problem, db-tools and the the load method expect a Drupal db. So, we need to do something different.

Talked to phenaproxima about this in #drupal-migrate, He suggested a temporary hack where the db is dumped with mysqldump and then loaded via by reading the entire SQL file into memory with file_get_contents() and call db_query().
db_query(file_get_contents('fixture.sql'))

So, I am going to try that here.

A new issue has been created for the wider issue of loading non Drupal db test fixtures, #2894055: Creating and loading non drupal db test fixtures.

quietone’s picture

No, does work. Even tried reading it line by line, as in, https://stackoverflow.com/questions/18559875/php-mysqldump-file-import. But it fails on inserting serialized data.

quietone’s picture

Let's revert this.

heddn’s picture

Does this still need a revert?

quietone’s picture

Yes, it contains a WooCommerce test fixture that we can't load.

Any work on solving that is in #2894055: Creating and loading non drupal db test fixtures.

quietone’s picture

Yes, this needs a revert.

  • quietone committed daaac4c on 8.x-2.x
    Revert "Issue #2876446 by quietone: WooCommerce Migration"
    
    This reverts...
quietone’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.