Porting drupal configuration with configuration management module


This article explains how to port drupal configurations from one site to another. First we will create a custom content type and then port it over to another drupal site.

1. Create first instance of drupal

$ drush dl drupal --drupal-project-rename=frominstallation
$ cd frominstallation
$ drush site-install standard --db-url='myql://root:vagrant@localhost:8080/frominstallation --site-name=FROM --account-name=admin --account-pass=1234
$ drush dl configuration
$ drush en configuration_ui -y

2. Create second instance of drupal

$ cd..
$ drush dl drupal --drupal-project-rename=toinstallation
$ cd toinstallation
$ drush site-install standard --db-url='myql://root:vagrant@localhost:8080/toinstallation --site-name=TO --account-name=admin --account-pass=1234
$ drush dl configuration
$ drush en configuration_ui -y

3. Create a new content type

a. log into frominstallation drupal instance b. click on structure > Add content type c. type testcc for name and “Create Content Type”

4. Start tracking the content type configuration

a. click on Configuration > configuration Management b. Under “Not Tracking” tab, check “testcc” and click on “Start Tracking” c. This would create many inc files in /sites/default/files/config folder

5. Port configuration over the second drupal installation

a. copy the contents of config file of frominstallation instance to toinstallation b. cd to toinstalltion directory c. drush config-sync d. log into toinstallation drupal instance to verify the new content type was ported correctly.