I have a dev and prod instance of my site. I cloned my Prod to my Dev server. Now I created a new display block inside an existing view on Dev. I tested it and it works. Now i want to export it to my Prod, but it has the same View name. I can manually create it on prod, but thats the slow way of doing it. If i export the view code and paste it to my prod, would it throw an error saying that view exist? Or would it just merge the changes and add in the new display i created?
2 Answers
The views import form has this option:
Replace an existing view if one exists with the same name.
It does what it says.
WHOA STOP. haha
Install the Features module and create a feature with this View in it and deploy (git/sftp) the Feature up to production. then revert feature and boom. latest view is there.
- Download, enable Features on Dev
- Create a new Feature
- Add your View to this Feature
- Save the exported feature into your file system for Drupal
- Enable on Dev and verify that it is in the default state (it should be)
- Download, enable Features on Prod (or use git to merge you dev branch into prod)
- Place this new Feature onto prod (either using git or SFTP)
- Enable this feature on prod. Since you have the View already, it will probably be Overridden. You can simply view differences (using Diff module) or revert it.
Note: I highly recommend a staging environment between development and production so you can test these types of reverts and adjustments prior to making changes on a production site.
-
so in prod create a feature with this view in it? then do the modifications in dev then import it back? Commented Oct 16, 2015 at 18:01
-
You don't have to do that. Since you have the View in dev, you can simply install Features (dev) and then export it from Dev. You will need to install Features and enable it on production prior to reverting. Commented Oct 16, 2015 at 18:03
-
reverting? u mean importing it to my prod? so just save the view as a feature on dev. then copy that feature to prod and enable it? Commented Oct 16, 2015 at 18:20
-