2

I'm a Drupal beginner with a problem.

I'm gonna do some updates on a live site which requires some new views to be created, and with that some new content types and blocks. I'm working off my local dev site doing these changes there first and then I'd like to be able to export these views as a package with the content types and blocks that they handle. Is this possible?

Of course I could just export my local database and import it on the live site, but the problem is that the live site is very active so the database is always changing. And my updates will take at least a week to do, so I can't keep up.

Any suggestions?

4

By Default views have option to import and export. By using that we can do it.

In drupal7 views3.x has option of import link in this url admin/structure/views

With this image you will get clear view of how to import and export a view.

enter image description here

  • Thanks! I missed that option since I was hanging around inside the view to be exported. Does this export bring all associated data with it, like the block and new content types? – Johan Dahl Aug 8 '13 at 7:51
  • it just export the views structure. Like pages, block, feeds..in your views. Not include content types. To include content types you need Feature moudule like @Rotem answer – Stone Vo Aug 8 '13 at 8:03
  • 1
    where is this in 8? – albo Feb 12 '16 at 16:40
  • To add to stone vo's comments, you can use a simpler way to export/import content types (not their data). The module name is bundle_copy – Ejaz Mar 15 '16 at 16:45
3

In addition to the views module I also recommend you to use the Features module that allows you to export your content types and lot more to code and then just commit the new code and revert it to DB on production.

1

Surely, Import/Export of Views will do the job (for exporting views only), but I would invest time in Configuration Management module. It has ALL the possible options, not only for views, but also for nodes, content types. I don't recommend using Features module, since I experienced a lot of bugs and unexpected behaviour with it. In case you want to copy content types (quick-dirty solution), I recommend the module BundleCopy Regards.

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.