drush wfi does not import data exported with wfx

Created on 30 January 2023, over 2 years ago

Problem/Motivation

I wanted to try out whether export and re-import works as from the usage description in drush, I feel it should.

Steps to reproduce

Create form, add submission.
drush wfx myform --destination=test_ex.csv --exporter=delimited
Export works successfully (when applying https://www.drupal.org/files/issues/2023-01-26/3335851-4.patch to 6.1.4)
Then, purge all submissions:
drush wfp myform
Success.
Then, try to import the exported submissions again, you need to pm:enable webform_submission_export_import first for this to work.
drush wfi myform test_ex.csv
This fails because it states mandatory fields are missing (which is wrong, they are part of the exported CSVs).

If I skip the validation with --skip_validation=<first field that needs validation>, the import basically seems to work, apart from errors like
> [error] <myform>: Email not sent for <myhandler> handler because a To, CC, or BCC email was not provided
(which is also wrong, as the export definitely contains the needed fields).
I am unsure what value to pass for --skip_validation[=SKIP_VALIDATION] as a description for the needed value is missing from the usage output (I guess a comma separated list of fields?)

The import ends with

>  [notice] Imported 4 of 4 submissions…
>  [notice] Submission import completed. (total: 4; created: 4; updated: 0; skipped: 0)

However, I don't see any relevant data in the submissions, only 127.0.0.1 as submission IP gets added, but no actual submission data.

There is no data added to table webform_submission_data.

🐛 Bug report
Status

Active

Version

6.1

Component

Code

Created by

🇦🇹Austria tgoeg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @tgoeg
  • Status changed to Closed: duplicate over 2 years ago
  • 🇦🇹Austria tgoeg

    I do not see how the related issue is a duplicate of this one.
    Is the patch for the export in the related ticket supposed to fix the import in this ticket?
    If so, then I'm afraid to say it doesn't.

    I am on 6.1.4 with the patch applied successfully (otherwise I wouldn't be able to export data at all)

  • Status changed to Active about 2 years ago
  • 🇦🇹Austria tgoeg

    Reopening, as 🐛 Webform 6.1.4 breaks drush data export Fixed only fixed the export (it mentioned this problem here, but this ticket is more precise, i.e. only describes the import issue), is closed already and most current 6.2.x still shows this error.

  • 🇯🇵Japan kensuke-imamura

    The CSV files generated by drush wfx with --exporter=delimited option do not contain complete information and not suitable for import.
    To obtain comprehensive data, you should use drush wfx with --exporter=webform_submission_export_import. The exporter is provided by the webform_submission_export_import module and is designed for direct re-import without modifications.

  • 🇦🇹Austria tgoeg
    $ drush pm:enable webform_submission_export_import
    >  [notice] Updated default configuration to de
    >  [warning] No configuration objects have been updated.
    >  [notice] Message: Es wurden keine Konfigurationsobjekte aktualisiert.
    >
     [success] Successfully enabled: webform_submission_export_import
    $ drush wfx --help | head -n7
    Exports webform submissions to a file.
    
    Arguments:
     [webform] The webform ID you want to export (required unless --entity-type and --entity-id are specified)
    
    Options:
     --exporter[=EXPORTER]                               The type of export. (delimited, table, yaml, or json)
    $ drush pm:list | grep "Submission Export/Import"
      Webform                              Webform Submission Export/Import                               Enabled    6.2.2

    Is this a hidden parameter option or is there something wrong with my installation?
    I don't see --exporter=webform_submission_export_import as a possible option here.

  • 🇯🇵Japan kensuke-imamura

    The allowed values for The type of export are hardcoded and do not reflect the actual possible values. If you enable the Webform Submission Export/Import module, you can use webform_submission_export_import.

  • 🇦🇹Austria tgoeg

    If that's the case, the option should be added to the help output, together with an info that it is only available if the module is installed.
    As it is now, no-one knows of it except when they read this ticket.

  • 🇺🇸United States jrockowitz Brooklyn, NY
  • 🇺🇸United States jrockowitz Brooklyn, NY

    We can't dynamically change the drush command's options but we can improve the xporter option description

    The type of export (i.e., delimited, table, yaml, or json). View all available exporters via /admin/reports/webform-plugins/exporters.

  • 🇺🇸United States jrockowitz Brooklyn, NY
  • Pipeline finished with Success
    about 2 months ago
    Total: 578s
    #583520
  • Pipeline finished with Skipped
    about 2 months ago
    #583584
  • 🇺🇸United States jrockowitz Brooklyn, NY
    • jrockowitz committed 00ee0486 on 6.3.x
      Issue #3337640 by jrockowitz, tgoeg, kensuke-imamura: drush wfi does not...
    • jrockowitz committed 00ee0486 on 6.x
      Issue #3337640 by jrockowitz, tgoeg, kensuke-imamura: drush wfi does not...
  • Pipeline finished with Success
    20 days ago
    Total: 1631s
    #607362
  • Pipeline finished with Success
    15 days ago
    Total: 256s
    #611497
  • Pipeline finished with Success
    15 days ago
    Total: 264s
    #611511
  • Pipeline finished with Canceled
    13 days ago
    Total: 168s
    #614589
  • Pipeline finished with Success
    13 days ago
    Total: 580s
    #614591
  • Pipeline finished with Failed
    12 days ago
    Total: 243s
    #615520
  • Pipeline finished with Failed
    12 days ago
    #615542
  • Pipeline finished with Success
    12 days ago
    #615729
  • Pipeline finished with Canceled
    12 days ago
    Total: 96s
    #615851
  • Pipeline finished with Canceled
    12 days ago
    Total: 180s
    #615850
  • Pipeline finished with Success
    12 days ago
    Total: 364s
    #615852
  • Pipeline finished with Success
    12 days ago
    #615866
  • Pipeline finished with Canceled
    12 days ago
    #615893
  • Pipeline finished with Success
    12 days ago
    #615894
Production build 0.71.5 2024