1ed16a913a60448563dd31cd2fa95e959f9f0c0a
[yaffs-website] / vendor / drush / drush / docs / config-exporting.md
1 # Exporting and Importing Configuration
2
3 Drush provides commands to export, transfer, and import configuration files
4 to and from a Drupal 8 site.  Configuration can be altered by different
5 methods in order to provide different behaviors in different environments;
6 for example, a development server might be configured slightly differently
7 than the production server.
8
9 This document describes how to make simple value changes to configuration
10 based on the environment, how to have a different set of enabled modules
11 in different configurations without affecting your exported configuration
12 values, and how to make more complex changes.
13
14 ## Simple Value Changes
15
16 It is not necessary to alter the configuration system values to 
17 make simple value changes to configuration variables, as this may be
18 done by the [configuration override system](https://www.drupal.org/node/1928898).
19
20 The configuration override system allows you to change configuration
21 values for a given instance of a site (e.g. the development server) by
22 setting configuration variables in the site's settings.php file.
23 For example, to change the name of a local development site:
24 ```
25 $config['system.site']['name'] = 'Local Install of Awesome Widgets, Inc.';
26 ```
27 Note that the configuration override system is a Drupal feature, not
28 a Drush feature. It should be the preferred method for changing
29 configuration values on a per-environment basis; however, it does not
30 work for some things, such as enabling and disabling modules.  For
31 configuration changes not handled by the configuration override system,
32 you can use Drush configuration filters.
33
34 ## Ignoring Development Modules
35
36 If you have a certain list of modules that should only be enabled on
37 the development or staging server, then this may be done with the
38 built-in `--skip-modules` option in the config-export and config-import
39 commands.
40
41 For example, if you want to enable the 'devel' module on development
42 systems, but not on production server, you could define the following
43 configuration settings in your drushrc.php file:
44 ```
45 # $command_specific['config-export']['skip-modules'] = array('devel');
46 # $command_specific['config-import']['skip-modules'] = array('devel');
47 ```
48 You may then use `drush pm-enable` to enable the devel module on the
49 development machine, and subsequent imports of the configuration data
50 will not cause it to be disabled again.  Similarly, if you make changes
51 to configuration on the development environment and export them, then
52 the devel module will not be listed in the exports.
53
54 ## More Complex Adjustments
55
56 Drush allows more complex changes to the configuration data to be made
57 via the configuration filter mechanism.  In order to do this, you must
58 write some code inside a Drush extension.
59
60 See [Drupal Configuration Filtering](config-filter.md) for more information
61 on how to do this.