Document git config import workflow

Created on 4 November 2012, over 12 years ago
Updated 4 April 2025, 13 days ago

#1697256: Create a UI for importing new configuration β†’ introduces a user interface for importing configuration. The interface has been tested with a manual workflow, but not with the git workflow described in comment #93.

Test the patch with the following workflow, and confirm the results. Then, add initial documentation for the workflow on the handbook page linked from the config module's hook_help().

# SETUP DEV SITE
mkdir drupal_dev
cd drupal_dev
wget http://ftp.drupal.org/files/projects/drupal-8.x-dev.tar.gz
tar --strip-components=1 -zxvf drupal-8.x-dev.tar.gz
rm *.gz
git init
git add .
git commit -am "Drupal"

# FIX CONFIG.INFO SO THE PATCH WILL APPLY
vi core/modules/config/config.info.yaml
# Delete everything after "core = 8.x"
git commit -am "Stupid packaging script."

# APPLY THE PATCH
wget http://drupal.org/files/1697256-config-import-63_0.patch
git apply --index 1697256-config-import-63_0.patch
git commit -am "Latest CMI UI patch."

# SETUP SETTINGS.PHP
cd drupal_dev/sites/default
cp default.settings.php settings.php
mkdir files
chmod -R 777 *

# EDIT SETTINGS.PHP AND REPLACE LINE 273 WITH THE FOLLOWING
$config_directories = array(
  CONFIG_ACTIVE_DIRECTORY => array('path' => 'config_xyzzy/dev_to_live'),
  CONFIG_STAGING_DIRECTORY => array('path' => 'config_xyzzy/live_to_dev'),
);

# INSTALL DRUPAL AS YOU SEE FIT

# ADD CONFIG TO GIT
cd config_xyzzy/live_to_dev/
touch README.txt
cd ../../..
git add files
git commit -m "Adding files directory" files
cd ../../..

# SETUP LIVE SITE
git clone file:///Users/gdd/Sites/drupal_dev drupal_live

# SETUP SETTINGS.PHP
cd drupal_live/sites/default
cp default.settings.php settings.php
mkdir files
chmod -R 777 *

# EDIT SETTINGS.PHP AND REPLACE LINE 273 WITH THE FOLLOWING
# NOTE THAT THE ACTIVE AND STAGING DIRECTORIES ARE REVERSED FROM ABOVE
$config_directories = array(
  CONFIG_ACTIVE_DIRECTORY => array('path' => 'config_xyzzy/live_to_dev'),
  CONFIG_STAGING_DIRECTORY => array('path' => 'config_xyzzy/dev_to_live'),
);

# INSTALL DRUPAL AS YOU SEE FIT

# ADD CONFIG TO GIT
git add files
git commit -am "Adding live site config"

Related issues:

πŸ“Œ Task
Status

Postponed: needs info

Component

Missing documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States xjm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Since there has been no discussion here for 8 years I am asking if this still needs to be done. Is this still relevant?

    Since we need more information to move forward with this issue, I am setting the status to Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

Production build 0.71.5 2024