I would like to move various views (panels?) from my dev site to my staging site. Which module will allow me to do this? I

Comments

kbrinner’s picture

There are (at least) 2 modules that you could check out for this: Bulk Exporter (part of CTools) and Features.

I have found that Bulk Exporter is more reliable for exporting Views than Features. To use Bulk Exporter:

  1. Enable the Bulk Exporter module
  2. Go to Structure -> Bulk Exporter
  3. Select Views (on the left) and then tick off the views you want to export. Bulk exporter will essentially create a custom module for you that contains all of the views you export
  4. Give your module a name (ie [mysite]_custom_views) and then click the Export button
  5. Copy and paste the text on the next screen into the files as instructed by the bulk exporter at sites/all/modules/custom/[mysite]_custom_views

You can then enable your new custom module and confirm that all of your desired Views have been captured in code by going to Structure -> Views. Under the View Name column, the views you have exported should be listed as 'In code'. Upload your custom module to your staging site, enable it, and then go to Structure -> Views. If any of the views you exported are listed as 'Database overriding code', in the operations column, click the dropdown and select Revert to revert your views to what you've exported as part of your custom module.

Features is kind of similar. Enable the module, then go to Structure -> Features and click on the Create Feature module. Here you can give your feature a name and select the various Views, Dependencies, Image Styles etc associated with your views. Download the feature, and then upload to sites/all/modules/features/[your-feature-name]. Enable your feature under modules, and then it hypothetically should essentially work in a similar way to Bulk Exporter. If you see your feature is overriden (at Structure -> Features) you can try reverting it, but I have found that this sometimes doesn't work. That said, Bulk Exporter always seems to work (at least as far as I've used it) so I would recommend that route. They are both pretty easy to use.