This project is not covered by Drupal’s security advisory policy.
Give you the possibility to synchronize configurations from and to different environments.
After you defined all your environments you should not use drush cex and drush cim because env_sync module will manage configurations by environment, use drush env_sync:cex and drush env_sync:cim instead.
Changes from Beta1
Go to /admin/config/development/env_sync/environments and manage your environments and your configurations from the Drupal administration interface.
Manage environments
Use the drush command line to manage all your environments.
Create an environment:
drush env_sync:add dev // create a dev environment
drush env_sync:add integ // create an integ environment
drush env_sync:add prod // create a prod environment
Remove an environment:
You can remove an environment if you don't need it anymore.
drush env_sync:del integ // remove the integ environment
List of environments:
See the list of all configured environments.
drush env_sync:list
Set your base environment
The base environment is the development environment, all configurations will be exported from this environment.
Configurations that will change from the dev environment (like google analytics, solr server, redis server conf...) will be set in the other environments (see the section "Set and unset configurations" below).
Set a base environment:
drush env_sync:base dev // in this case the dev environment will be your base environment
drush env_sync:add integ --base // create the integ enviroment and set it as the base environment in the same time
Set the current environment
The current environment is used to export and import configurations in the good folder.
When you are on the "prod" server you have to set the current environment as "prod" and when you have on the "dev" machine you have to set the current environment as "dev".
You have 2 way in order to set the current environment.
Set the current environment in settings.php
$settings['env_sync.current_environment'] = 'prod'; // Set the current environment as prod.
Set the current environment in state database with drush
drush env_sync:current prod // Set the current environment as prod.
Remove the current environment from state database with drush
This command will not remove the current environment if it's defined in settings.php.
The current environment will still defined if you set it in settings.php.
drush env_sync:current --remove // Remove the current environment.
caution: the settings.php definition will override the database definition. If you want to use the state database one, you will have to remove the definition in settings.php.
Set and unset configurations
Add a configuration to an environment.
When you add a configuration name to an environment, it's just the meaning to tell
caution, in this environment, this configuration will be different than the configuration in the base environment.
Set a specific configuration to an environment
drush env_sync:set_conf google_analytics.settings prod
Unset a specific configuration from an environment
drush env_sync:unset_conf google_analytics.settings prod
Import and export configurations
For these commands you don't have to tell which configurations to import or export and where because you already defined a current environment and all configurations that are differents from the base environment.
Import configurations in an environment
drush env_sync:cim
Export configurations from an environment
drush env_sync:cex
Project information
- Module categories: Administration Tools, Developer Tools
- 6 sites report using this module
- Created by OlivierG on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.