1

I wanted to experiment and see if I could just import all the webforms, webform data, submissions, configurations, etc. from one Drupal 7 site to a new one. The import seems to have gone well but I can't see anything, even after clearing the caches. I even performed a MySQL query on the new site to see if the tables were actually populated.

    mysqldump -u root -p database_name webform webform_component 
webform_conditional webform_conditional_actions webform_conditional_rules 
webform_emails webform_last_download webform_report webform_roles 
webform_submissions webform_submitted_data webform_validation_rule 
webform_validation_rule_components content_type_webform> webforms.sql

Then I logged into mysql, chose the correct database and imported it: source webforms.sql

Did I miss some other crucial table or something else? I have had a lot of success with migrating users and other info over this way even though I'm not sure it's wise and haven't found much in the way of doing data migration for Drupal without modules.

2

Webforms are nodes, so you'll also need to bring the node (and potentially field and other depending on your site's configuration) data across.

Make sure the node ids for the webforms are the same as they were in the original site, or you'll have to do some manual work to get the data linked back up again.

This is why it's arguably better to migrate content, rather than do a raw data export/import, as it gives you the opportunity to massage/prepare data as required for the new system.

  • Now I have imported my webforms using node export. How do I import the data into them? – Christia Apr 21 '17 at 17:50
  • I'm not sure what you mean. As long as you've kept the node ids the same, and you've copied the Webform data in full, you're done – Clive Apr 21 '17 at 17:52
  • Node Export seems to only export the code for the form field configurations, not the actual data. It also creates a new node ID on the new website. I'm still missing a big piece of this picture. I'm trying to go with your suggestion of doing migration instead of raw MySQL imports. – Christia Apr 21 '17 at 18:32
  • 3
    A migration will be more robust. But if you've copied all the webform data, a simple solution might be to just create new webform node(s), and edit the webform table manually to update the nids if that makes sense? – Clive Apr 21 '17 at 19:04
  • 3
    Backup first of course ;) But the webform fields/submissions/etc are all linked to the display node through that nid column in the webform table, so in theory the worst that will happen is it doesn't work and you need to go the longer way round – Clive Apr 21 '17 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.