How do I export/import views?


Views are configuration entities in Drupal 8, and can be exported via the Configuration Management module.

Views are available through configuration in Drupal 8, and can be exported via the Configuration Management interface.

In the admin menu select "Configuration" in the DEVELOPMENT section, select "Configuration synchronization": Drupal 8 Configuration Development menu area

In that menu area, the Export tab leads to the path: http://sitename/admin/config/development/configuration/single/export

In that area, a single view can be exported or imported, and the steps are about the same so I'll include Export here to help explain.

  1. Select 'Export' menu tab.
  2. Select 'Single item' sub menu tab.
  3. From the first item drop down 'Configuration type' select 'View'.
  4. From the second item drop down 'Configuration name' select the name of your view.

The result is a views.view.view_machine_name.yml "YAML" file that can be copy pasted into the 'Import' area.

If you'd like to export a view for use in the default configuration of a custom module, you can run a Drupal Console command:

drupal config:export:view

See: config:export:view docs page.

Tags: Views / Drupal 8

Similar questions

Is it possible to alter nodes on export with Node Export
I want to write my own module which changes a few things upon exporting of nodes with Node Export. I saw that there are some API's. But I haven't seen any working examples. Is there some documentation on the API of Node Export? And if not can someone provide me with some examples of changing data for export and changing it again upon import? Thanks...
Huge CCK field export/import
I am having troubles exporting and importing a large numbers of CCK fields using Content copy (I need to have a file download/upload option). Is there a SQL (or drush) command that can export and import CCK fields? I am interested in anything that bypasses the PHP memory limitations, 504 gateway time-outs, and what not. Maybe I could still use HTTP...
How to import / export content type?
In Drupal 6 we had content type export import, I cannot find this in Drupal 7. Any tips please?
How do I export fields of a content type in one website and import it into another website?
I'm trying to set up a data export through views that includes the title and a couple of fields of a content type and import it into another website. I'm using Feeds and Views Data Export and also tried Views XML but is doesn't seem to work. How do I export fields and import them by creating nodes in another website?
Is there a module or functionality to export/import roles and permissions?
I have been searching for a module or functionality to export/import roles and permission from one installation to another, but could not find it. Is there such a functionality or module for Drupal 7?
How can I export and import users and their content (preferably as code)?
I've been using the features module successfully to manage configuration changes in content across my dev and production sites. However, I have a site that is heavily focused on user relationships and I have created a large number of dummy users to test it. I can't use the devel module to do this because I need to create content for each dummy user...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.