Is there a module to automate exporting/importing a batch of Views (for import onto another site?)

I have a Commerce Kickstart site with demo data. I can't figure out how to remove the demo data without resetting the site, so I'm going to start over.

I want to take some Views I created myself with me. (Unless someone has the magic trick to remove all Commerce Demo data...including Product Types without using Reset() of course. :D )



I have often been advised to just save my Views as a Feature. Any reason this won't do the required?

  • Actually that's exactly the answer I needed. Thanks. – jchwebdev Nov 17 '14 at 18:32
  • Bala - pretty new to Stack Exchange. I would like some clarification on how to 'offer suggestions' so that they are not seen as inappropriate. I understand I did not provide a pointer to "a module to automate exporting/importing a batch of Views' but in 5 years of working with Views had not stumbled across such a beast. Hence suggesting something that might get close to what I perceived as the underlying requirement, namely, getting lots of Views off site-X and on to site-Y. Should I have suggested that in a 'comment' rather than an 'answer'? – petednz - fuzion Nov 18 '14 at 19:49
  • jchwebdev - should you 'accept' this answer then? still trying to figure how S.E. works best. DOH - sorry, guess that is what the LARGE GREEN TICK is. – petednz - fuzion Nov 20 '14 at 9:16

You are mistaken between the terms. The views you getting by default are already exported so you don't need to export what is already exported unless you made some changes. What you do want to do is delete all the content you get from the installation. The content is being migrated with the migrate module. In order to remove the data you need to enable the migrate UI module and then go to admin/content/migrate and then check all the migrate handlers and select role back.

  • The problem is that Kickstart doesn't work with the latest Migrate (or Commerce Migrate). Apparently, if one wants to start over with Kickstart, you can't just delete your products and orders, you have to do a Reset() and reinstall and then re-create all the content/modules/taxonomies/etc. The various demo data is Strongarmed... and this is where I'm over my head. Unless someone can tell me how to -cleanly- remove the demo data (including Product Types) I just want to take some custom views I have created, export them and start over. – jchwebdev Nov 14 '14 at 19:58
  • While working with commerce guys on the kickstart distro. i remembered there is an option to roll-back. I install commerce kickstart with .simplytest.me. I enabled the migrate ui module and i managed to role-back the content. – Roy Segall Nov 14 '14 at 21:31
  • We're veering off-topic (it's my fault--my annoyance with Kickstart periodically bubbles out). You -can- do as you say, if you knew to follow your procedure ahead of time. We started entering data we like BEFORE we knew that there were no way to remove the demo data ex post facto – jchwebdev Nov 15 '14 at 2:47
  • So... it seems like one can do as I asked (export Views) using Features, right? TIA. – jchwebdev Nov 15 '14 at 2:48
  • Migrate will roleback only the data he imported. Data that migrated did not imported will not affect the role back process. If you scared you make a backup of you DB and see what happen when role backing the imported content. – Roy Segall Nov 15 '14 at 16:23

To remove all the commerce example data, you might use Administration Views + Views Bulk Operations + (Commerce VBO Views or Commerce Backoffice) to identify and delete all your sample products, orders etc.

Note that you might run into some situations where a product can't be removed since it's referred to by a line item which is part of a product; if this happened you might need to remove the orders and associated line items before removing the products, then the product types (etc - read as hypothetical example).

However, it's valuable being able to rebuild the site from basics, and in that case the route of exporting Views as Features as Pete suggests is a sensible one. This path will have more of a learning curve but has advantages for you longer term - eg it's much easier to track development stored as code than all globbed together in a DB, big advantages when dealing with unexpected problems later on ...

  • We're getting totally O/T but Kickstart has built-in code that automatically rebuilds the demo data even if one tries to delete via SQL. I guess this is 'Strongarm' in action? It doesn't bug me that this is the case, but the devs should have the courtesy to point out -where- that code lies so it can be gracefully removed without reverse-engineering or having to rebuild from scratch. I (and many others) have asked several times over the years and been ignored. For open-source this seems less 'open' than one might hope. It's MEANT for newbs so it should be far more forgiving. – jchwebdev Nov 20 '14 at 22:33
  • I see. And yes, now that I've run a search for others in your situation, I see that this is actually documented behaviour. So I've added a separate answer clarifying this. – Chris Burgess Nov 21 '14 at 4:01
  • Unrelated: I had to look twice to tell whether or not the DrupalCommerce.org forums are StackExchange or not :) – Chris Burgess Nov 21 '14 at 4:02

This appears to have been answered previously in the Drupal Commerce forums.

Demo store product types, content types and categories are not deletable (due to the way how the Features module works), which is why the demo store can't be used for new projects (which is something we say quite clearly on the project page)

Please note that the "demo store" has been built to demonstrate the capabilities of Kickstart and shouldn't be used when starting new sites.

So it does appear that the correct solution is to export your customisations (Views etc via Features), and to rebuild the store from Kickstart without the Demo Store.

Sorry :(

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.