From bfb117c5699c42e55c9d443c852f11352c1a6ce4 Mon Sep 17 00:00:00 2001
From: xjm <xjm@65776.no-reply.drupal.org>
Date: Mon, 5 Oct 2015 18:29:54 -0500
Subject: [PATCH] Issue #2487588 by YesCT, Leksat, Schnitzel, alexpott,
 anavarre, xjm: Move CMI import/export directory "staging" to "sync", as it is
 confused with staging environments

---
 core/core.api.php                             |   2 +-
 core/core.services.yml                        |   6 +-
 core/includes/bootstrap.inc                   |  18 ++-
 core/includes/file.inc                        |   2 +-
 core/includes/install.core.inc                |   2 +-
 core/includes/install.inc                     |  28 ++---
 .../lib/Drupal/Core/Config/ConfigImporter.php |   6 +-
 .../Config/Entity/ConfigDependencyManager.php |   6 +-
 .../Drupal/Core/Config/FileStorageFactory.php |   6 +-
 core/modules/config/config.module             |   4 +-
 .../src/Controller/ConfigController.php       |   2 +-
 .../config/src/Form/ConfigImportForm.php      |   4 +-
 core/modules/config/src/Form/ConfigSync.php   |  16 +--
 .../Tests/AssertConfigEntityImportTrait.php   |   4 +-
 .../config/src/Tests/ConfigDiffTest.php       |  56 +++++-----
 .../src/Tests/ConfigEntityStorageTest.php     |   2 +-
 .../src/Tests/ConfigExportImportUITest.php    |  16 +--
 .../src/Tests/ConfigFileContentTest.php       |   2 +-
 .../config/src/Tests/ConfigImportAllTest.php  |   6 +-
 .../Tests/ConfigImportInstallProfileTest.php  |  18 +--
 .../src/Tests/ConfigImportRecreateTest.php    |  10 +-
 .../ConfigImportRenameValidationTest.php      |  10 +-
 .../config/src/Tests/ConfigImportUITest.php   |  84 +++++++-------
 .../ConfigImporterMissingContentTest.php      |  12 +-
 .../config/src/Tests/ConfigImporterTest.php   | 104 +++++++++---------
 .../config/src/Tests/ConfigOverrideTest.php   |  10 +-
 .../config/src/Tests/ConfigSnapshotTest.php   |  20 ++--
 .../ContentTranslationConfigImportTest.php    |  10 +-
 .../field/src/Tests/FieldImportChangeTest.php |  10 +-
 .../field/src/Tests/FieldImportCreateTest.php |  26 ++---
 .../field/src/Tests/FieldImportDeleteTest.php |  16 +--
 .../Tests/FieldImportDeleteUninstallTest.php  |  16 +--
 .../FieldImportDeleteUninstallUiTest.php      |  12 +-
 ...st.entity_test.field_test_import_sync.yml} |   8 +-
 ....test_bundle.field_test_import_sync_2.yml} |   6 +-
 ...est_bundle_2.field_test_import_sync_2.yml} |   6 +-
 ...ge.entity_test.field_test_import_sync.yml} |   4 +-
 ....entity_test.field_test_import_sync_2.yml} |   4 +-
 .../image/src/Tests/ImageAdminStylesTest.php  |   8 +-
 .../LanguageConfigOverrideImportTest.php      |  30 ++---
 .../src/Tests/Config/NodeImportChangeTest.php |  10 +-
 .../src/Tests/Config/NodeImportCreateTest.php |  12 +-
 .../{staging => sync}/node.type.import.yml    |   0
 .../src/Tests/OptionsFloatFieldImportTest.php |   4 +-
 .../modules/simpletest/src/KernelTestBase.php |  12 +-
 core/modules/simpletest/src/TestBase.php      |   2 +-
 .../Tests/Entity/ConfigEntityImportTest.php   |  14 +--
 .../Entity/ContentEntityNullStorageTest.php   |  10 +-
 ...InstallerExistingSettingsNoProfileTest.php |   6 +-
 .../InstallerExistingSettingsTest.php         |   6 +-
 .../Entity/ViewEntityDependenciesTest.php     |   2 +-
 .../Drupal/KernelTests/KernelTestBase.php     |   8 +-
 .../Drupal/KernelTests/KernelTestBaseTest.php |   2 +-
 sites/default/default.settings.php            |   8 +-
 54 files changed, 364 insertions(+), 344 deletions(-)
 rename core/modules/field/tests/modules/field_test_config/{staging/field.field.entity_test.entity_test.field_test_import_staging.yml => sync/field.field.entity_test.entity_test.field_test_import_sync.yml} (56%)
 rename core/modules/field/tests/modules/field_test_config/{staging/field.field.entity_test.test_bundle.field_test_import_staging_2.yml => sync/field.field.entity_test.test_bundle.field_test_import_sync_2.yml} (63%)
 rename core/modules/field/tests/modules/field_test_config/{staging/field.field.entity_test.test_bundle_2.field_test_import_staging_2.yml => sync/field.field.entity_test.test_bundle_2.field_test_import_sync_2.yml} (64%)
 rename core/modules/field/tests/modules/field_test_config/{staging/field.storage.entity_test.field_test_import_staging.yml => sync/field.storage.entity_test.field_test_import_sync.yml} (79%)
 rename core/modules/field/tests/modules/field_test_config/{staging/field.storage.entity_test.field_test_import_staging_2.yml => sync/field.storage.entity_test.field_test_import_sync_2.yml} (79%)
 rename core/modules/node/tests/modules/node_test_config/{staging => sync}/node.type.import.yml (100%)

diff --git a/core/core.api.php b/core/core.api.php
index 6415c4f10c52..69e074ccaf15 100644
--- a/core/core.api.php
+++ b/core/core.api.php
@@ -115,7 +115,7 @@
  *   and HAL.
  * - Node entity support is configured by default. If you would like to support
  *   other types of entities, you can copy
- *   core/modules/rest/config/install/rest.settings.yml to your staging
+ *   core/modules/rest/config/install/rest.settings.yml to your sync
  *   configuration directory, appropriately modified for other entity types,
  *   and import it. Support for GET on the log from the Database Logging module
  *   can also be enabled in this way; in this case, the 'entity:node' line
diff --git a/core/core.services.yml b/core/core.services.yml
index e7915724937f..f867f8848f1f 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -290,9 +290,13 @@ services:
     public: false
     tags:
       - { name: backend_overridable }
+  # @deprecated in Drupal 8.0.x and will be removed before 9.0.0. Use
+  #   config.storage.sync instead.
   config.storage.staging:
     class: Drupal\Core\Config\FileStorage
-    factory: Drupal\Core\Config\FileStorageFactory::getStaging
+    factory: Drupal\Core\Config\FileStorageFactory::getSync
+  config.storage.sync:
+    alias: config.storage.staging
   config.storage.snapshot:
     class: Drupal\Core\Config\DatabaseStorage
     arguments: ['@database', config_snapshot]
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index adc29235a282..6b6d897e6792 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -108,10 +108,21 @@
  */
 const CONFIG_ACTIVE_DIRECTORY = 'active';
 
+/**
+ * $config_directories key for sync directory.
+ *
+ * @see config_get_config_directory()
+ */
+const CONFIG_SYNC_DIRECTORY = 'sync';
+
 /**
  * $config_directories key for staging directory.
  *
  * @see config_get_config_directory()
+ * @see CONFIG_SYNC_DIRECTORY
+ *
+ * @deprecated in Drupal 8.0.x and will be removed before 9.0.0. The staging
+ *   directory was renamed to sync.
  */
 const CONFIG_STAGING_DIRECTORY = 'staging';
 
@@ -130,7 +141,7 @@
  *
  * @param string $type
  *   The type of config directory to return. Drupal core provides the
- *   CONFIG_STAGING_DIRECTORY constant to access the staging directory.
+ *   CONFIG_SYNC_DIRECTORY constant to access the sync directory.
  *
  * @return string
  *   The configuration directory path.
@@ -140,6 +151,11 @@
 function config_get_config_directory($type) {
   global $config_directories;
 
+  // @todo Remove fallback in Drupal 9. https://www.drupal.org/node/2574943
+  if ($type == CONFIG_SYNC_DIRECTORY && !isset($config_directories[CONFIG_SYNC_DIRECTORY]) && isset($config_directories[CONFIG_STAGING_DIRECTORY])) {
+    $type = CONFIG_STAGING_DIRECTORY;
+  }
+
   if (!empty($config_directories[$type])) {
     return $config_directories[$type];
   }
diff --git a/core/includes/file.inc b/core/includes/file.inc
index 316c54f3a171..4200b87b86e0 100644
--- a/core/includes/file.inc
+++ b/core/includes/file.inc
@@ -335,7 +335,7 @@ function file_ensure_htaccess() {
     file_save_htaccess('private://', TRUE);
   }
   file_save_htaccess('temporary://', TRUE);
-  file_save_htaccess(config_get_config_directory(CONFIG_STAGING_DIRECTORY), TRUE);
+  file_save_htaccess(config_get_config_directory(CONFIG_SYNC_DIRECTORY), TRUE);
 }
 
 /**
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 4b6532cc0897..bd7b7ecd24b7 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -362,7 +362,7 @@ function install_begin_request($class_loader, &$install_state) {
   \Drupal::setContainer($container);
 
   // Determine whether base system services are ready to operate.
-  $install_state['config_verified'] = install_ensure_config_directory(CONFIG_STAGING_DIRECTORY);
+  $install_state['config_verified'] = install_ensure_config_directory(CONFIG_SYNC_DIRECTORY);
   $install_state['database_verified'] = install_verify_database_settings($site_path);
   $install_state['settings_verified'] = $install_state['config_verified'] && $install_state['database_verified'];
 
diff --git a/core/includes/install.inc b/core/includes/install.inc
index e9e11943b0ce..162d9c905b9e 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -202,8 +202,8 @@ function drupal_get_database_types() {
  *   and comment properties.
  *   @code
  *   $settings['config_directories'] = array(
- *     CONFIG_STAGING_DIRECTORY => (object) array(
- *       'value' => 'config_hash/staging',
+ *     CONFIG_SYNC_DIRECTORY => (object) array(
+ *       'value' => 'config_hash/sync',
  *       'required' => TRUE,
  *     ),
  *   );
@@ -211,7 +211,7 @@ function drupal_get_database_types() {
  *   gets dumped as:
  *   @code
  *   $config_directories['active'] = 'config_hash/active';
- *   $config_directories['staging'] = 'config_hash/staging'
+ *   $config_directories['sync'] = 'config_hash/sync'
  *   @endcode
  */
 function drupal_rewrite_settings($settings = array(), $settings_file = NULL) {
@@ -487,9 +487,9 @@ function drupal_install_config_directories() {
   // manually defined in the existing already.
   $settings = [];
   $config_directories_hash = Crypt::randomBytesBase64(55);
-  if (empty($config_directories[CONFIG_STAGING_DIRECTORY])) {
-    $settings['config_directories'][CONFIG_STAGING_DIRECTORY] = (object) [
-      'value' => \Drupal::service('site.path') . '/files/config_' . $config_directories_hash . '/staging',
+  if (empty($config_directories[CONFIG_SYNC_DIRECTORY])) {
+    $settings['config_directories'][CONFIG_SYNC_DIRECTORY] = (object) [
+      'value' => \Drupal::service('site.path') . '/files/config_' . $config_directories_hash . '/sync',
       'required' => TRUE,
     ];
   }
@@ -505,19 +505,19 @@ function drupal_install_config_directories() {
   // public files directory, which has already been verified to be writable
   // itself. But if it somehow fails anyway, the installation cannot proceed.
   // Bail out using a similar error message as in system_requirements().
-  if (!install_ensure_config_directory(CONFIG_STAGING_DIRECTORY)) {
+  if (!install_ensure_config_directory(CONFIG_SYNC_DIRECTORY)) {
     throw new Exception(t('The directory %directory could not be created or could not be made writable. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see the <a href=":handbook_url">online handbook</a>.', array(
-      '%directory' => config_get_config_directory(CONFIG_STAGING_DIRECTORY),
+      '%directory' => config_get_config_directory(CONFIG_SYNC_DIRECTORY),
       ':handbook_url' => 'https://www.drupal.org/server-permissions',
     )));
   }
 
-  // Put a README.txt into the staging config directory. This is required so
-  // that they can later be added to git. Since this directory is auto-
-  // created, we have to write out the README rather than just adding it
-  // to the drupal core repo.
+  // Put a README.txt into the sync config directory. This is required so that
+  // they can later be added to git. Since this directory is auto-created, we
+  // have to write out the README rather than just adding it to the drupal core
+  // repo.
   $text =  'This directory contains configuration to be imported into your Drupal site. To make this configuration active, visit admin/config/development/configuration/sync.'  .' For information about deploying configuration between servers, see https://www.drupal.org/documentation/administer/config';
-  file_put_contents(config_get_config_directory(CONFIG_STAGING_DIRECTORY) . '/README.txt', $text);
+  file_put_contents(config_get_config_directory(CONFIG_SYNC_DIRECTORY) . '/README.txt', $text);
 }
 
 /**
@@ -525,7 +525,7 @@ function drupal_install_config_directories() {
  *
  * @param string $type
  *   Type of config directory to return. Drupal core provides 'active' and
- *   'staging'.
+ *   'sync'.
  *
  * @return bool
  *   TRUE if the config directory exists and is writable.
diff --git a/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php
index 13b87954c7dc..c7246be9b1d5 100644
--- a/core/lib/Drupal/Core/Config/ConfigImporter.php
+++ b/core/lib/Drupal/Core/Config/ConfigImporter.php
@@ -367,8 +367,8 @@ protected function createExtensionChangelist() {
     $current_extensions = $this->storageComparer->getTargetStorage()->read('core.extension');
     $new_extensions = $this->storageComparer->getSourceStorage()->read('core.extension');
 
-    // If there is no extension information in staging then exit. This is
-    // probably due to an empty staging directory.
+    // If there is no extension information in sync then exit. This is probably
+    // due to an empty sync directory.
     if (!$new_extensions) {
       return;
     }
@@ -780,7 +780,7 @@ protected function processConfiguration($collection, $op, $name) {
    *   The name of the extension to process.
    */
   protected function processExtension($type, $op, $name) {
-    // Set the config installer to use the staging directory instead of the
+    // Set the config installer to use the sync directory instead of the
     // extensions own default config directories.
     \Drupal::service('config.installer')
       ->setSyncing(TRUE)
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php b/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php
index 80180ce89131..3a9cde406810 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php
@@ -85,9 +85,9 @@
  * configuration object so that they can be checked without the module that
  * provides the configuration entity class being installed. This is important
  * for configuration synchronization, which needs to be able to validate
- * configuration in the staging directory before the synchronization has
- * occurred. Also, if you have a configuration entity object and you want to
- * get the current dependencies (without recalculation), you can use
+ * configuration in the sync directory before the synchronization has occurred.
+ * Also, if you have a configuration entity object and you want to get the
+ * current dependencies (without recalculation), you can use
  * \Drupal\Core\Config\Entity\ConfigEntityInterface::getDependencies().
  *
  * When uninstalling a module or a theme, configuration entities that are
diff --git a/core/lib/Drupal/Core/Config/FileStorageFactory.php b/core/lib/Drupal/Core/Config/FileStorageFactory.php
index 49ccbd92510a..58fdda54d083 100644
--- a/core/lib/Drupal/Core/Config/FileStorageFactory.php
+++ b/core/lib/Drupal/Core/Config/FileStorageFactory.php
@@ -25,12 +25,12 @@ static function getActive() {
   }
 
   /**
-   * Returns a FileStorage object working with the staging config directory.
+   * Returns a FileStorage object working with the sync config directory.
    *
    * @return \Drupal\Core\Config\FileStorage FileStorage
    */
-  static function getStaging() {
-    return new FileStorage(config_get_config_directory(CONFIG_STAGING_DIRECTORY));
+  static function getSync() {
+    return new FileStorage(config_get_config_directory(CONFIG_SYNC_DIRECTORY));
   }
 
 }
diff --git a/core/modules/config/config.module b/core/modules/config/config.module
index b5f2af30eb11..7a1256a9e29e 100644
--- a/core/modules/config/config.module
+++ b/core/modules/config/config.module
@@ -33,7 +33,7 @@ function config_help($route_name, RouteMatchInterface $route_match) {
 
     case 'config.sync':
       $output = '';
-      $output .= '<p>' . t('Compare the configuration uploaded to your staging directory with the active configuration before completing the import.') . '</p>';
+      $output .= '<p>' . t('Compare the configuration uploaded to your sync directory with the active configuration before completing the import.') . '</p>';
       return $output;
 
     case 'config.export_full':
@@ -43,7 +43,7 @@ function config_help($route_name, RouteMatchInterface $route_match) {
 
     case 'config.import_full':
       $output = '';
-      $output .= '<p>' . t('Upload a full site configuration archive to the staging directory. It can then be compared and imported on the Synchronize page.') . '</p>';
+      $output .= '<p>' . t('Upload a full site configuration archive to the sync directory. It can then be compared and imported on the Synchronize page.') . '</p>';
       return $output;
 
     case 'config.export_single':
diff --git a/core/modules/config/src/Controller/ConfigController.php b/core/modules/config/src/Controller/ConfigController.php
index c7152ffc256f..6fb342389528 100644
--- a/core/modules/config/src/Controller/ConfigController.php
+++ b/core/modules/config/src/Controller/ConfigController.php
@@ -64,7 +64,7 @@ class ConfigController implements ContainerInjectionInterface {
   public static function create(ContainerInterface $container) {
     return new static(
       $container->get('config.storage'),
-      $container->get('config.storage.staging'),
+      $container->get('config.storage.sync'),
       $container->get('config.manager'),
       new FileDownloadController(),
       $container->get('diff.formatter')
diff --git a/core/modules/config/src/Form/ConfigImportForm.php b/core/modules/config/src/Form/ConfigImportForm.php
index 7b29e3ff3486..c16dfe806cf0 100644
--- a/core/modules/config/src/Form/ConfigImportForm.php
+++ b/core/modules/config/src/Form/ConfigImportForm.php
@@ -40,7 +40,7 @@ public function __construct(StorageInterface $config_storage) {
    */
   public static function create(ContainerInterface $container) {
     return new static(
-      $container->get('config.storage.staging')
+      $container->get('config.storage.sync')
     );
   }
 
@@ -93,7 +93,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
         foreach ($archiver->listContent() as $file) {
           $files[] = $file['filename'];
         }
-        $archiver->extractList($files, config_get_config_directory(CONFIG_STAGING_DIRECTORY));
+        $archiver->extractList($files, config_get_config_directory(CONFIG_SYNC_DIRECTORY));
         drupal_set_message($this->t('Your configuration files were successfully uploaded and are ready for import.'));
         $form_state->setRedirect('config.sync');
       }
diff --git a/core/modules/config/src/Form/ConfigSync.php b/core/modules/config/src/Form/ConfigSync.php
index e9b14cb4e87a..3c176977152e 100644
--- a/core/modules/config/src/Form/ConfigSync.php
+++ b/core/modules/config/src/Form/ConfigSync.php
@@ -39,11 +39,11 @@ class ConfigSync extends FormBase {
   protected $lock;
 
   /**
-   * The staging configuration object.
+   * The sync configuration object.
    *
    * @var \Drupal\Core\Config\StorageInterface
    */
-  protected $stagingStorage;
+  protected $syncStorage;
 
   /**
    * The active configuration object.
@@ -111,7 +111,7 @@ class ConfigSync extends FormBase {
   /**
    * Constructs the object.
    *
-   * @param \Drupal\Core\Config\StorageInterface $staging_storage
+   * @param \Drupal\Core\Config\StorageInterface $sync_storage
    *   The source storage.
    * @param \Drupal\Core\Config\StorageInterface $active_storage
    *   The target storage.
@@ -134,8 +134,8 @@ class ConfigSync extends FormBase {
    * @param \Drupal\Core\Render\RendererInterface
    *   The renderer.
    */
-  public function __construct(StorageInterface $staging_storage, StorageInterface $active_storage, StorageInterface $snapshot_storage, LockBackendInterface $lock, EventDispatcherInterface $event_dispatcher, ConfigManagerInterface $config_manager, TypedConfigManagerInterface $typed_config, ModuleHandlerInterface $module_handler, ModuleInstallerInterface $module_installer, ThemeHandlerInterface $theme_handler, RendererInterface $renderer) {
-    $this->stagingStorage = $staging_storage;
+  public function __construct(StorageInterface $sync_storage, StorageInterface $active_storage, StorageInterface $snapshot_storage, LockBackendInterface $lock, EventDispatcherInterface $event_dispatcher, ConfigManagerInterface $config_manager, TypedConfigManagerInterface $typed_config, ModuleHandlerInterface $module_handler, ModuleInstallerInterface $module_installer, ThemeHandlerInterface $theme_handler, RendererInterface $renderer) {
+    $this->syncStorage = $sync_storage;
     $this->activeStorage = $active_storage;
     $this->snapshotStorage = $snapshot_storage;
     $this->lock = $lock;
@@ -153,7 +153,7 @@ public function __construct(StorageInterface $staging_storage, StorageInterface
    */
   public static function create(ContainerInterface $container) {
     return new static(
-      $container->get('config.storage.staging'),
+      $container->get('config.storage.sync'),
       $container->get('config.storage'),
       $container->get('config.storage.snapshot'),
       $container->get('lock.persistent'),
@@ -183,8 +183,8 @@ public function buildForm(array $form, FormStateInterface $form_state) {
       '#type' => 'submit',
       '#value' => $this->t('Import all'),
     );
-    $source_list = $this->stagingStorage->listAll();
-    $storage_comparer = new StorageComparer($this->stagingStorage, $this->activeStorage, $this->configManager);
+    $source_list = $this->syncStorage->listAll();
+    $storage_comparer = new StorageComparer($this->syncStorage, $this->activeStorage, $this->configManager);
     if (empty($source_list) || !$storage_comparer->createChangelist()->hasChanges()) {
       $form['no_changes'] = array(
         '#type' => 'table',
diff --git a/core/modules/config/src/Tests/AssertConfigEntityImportTrait.php b/core/modules/config/src/Tests/AssertConfigEntityImportTrait.php
index 6d9b29875fe2..05f53856d3cc 100644
--- a/core/modules/config/src/Tests/AssertConfigEntityImportTrait.php
+++ b/core/modules/config/src/Tests/AssertConfigEntityImportTrait.php
@@ -28,8 +28,8 @@ public function assertConfigEntityImport(ConfigEntityInterface $entity) {
     $entity_uuid = $entity->uuid();
     $entity_type_id = $entity->getEntityTypeId();
     $original_data = $entity->toArray();
-    // Copy everything to staging.
-    $this->copyConfig(\Drupal::service('config.storage'), \Drupal::service('config.storage.staging'));
+    // Copy everything to sync.
+    $this->copyConfig(\Drupal::service('config.storage'), \Drupal::service('config.storage.sync'));
     // Delete the configuration from active. Don't worry about side effects of
     // deleting config like fields cleaning up field storages. The coming import
     // should recreate everything as necessary.
diff --git a/core/modules/config/src/Tests/ConfigDiffTest.php b/core/modules/config/src/Tests/ConfigDiffTest.php
index 10f6902549e8..efb5db33a7d6 100644
--- a/core/modules/config/src/Tests/ConfigDiffTest.php
+++ b/core/modules/config/src/Tests/ConfigDiffTest.php
@@ -28,7 +28,7 @@ class ConfigDiffTest extends KernelTestBase {
    */
   function testDiff() {
     $active = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
     $config_name = 'config_test.system';
     $change_key = 'foo';
     $remove_key = '404';
@@ -43,44 +43,44 @@ function testDiff() {
     // Install the default config.
     $this->installConfig(array('config_test'));
 
-    // Change a configuration value in staging.
-    $staging_data = $original_data;
-    $staging_data[$change_key] = $change_data;
-    $staging_data[$add_key] = $add_data;
-    $staging->write($config_name, $staging_data);
+    // Change a configuration value in sync.
+    $sync_data = $original_data;
+    $sync_data[$change_key] = $change_data;
+    $sync_data[$add_key] = $add_data;
+    $sync->write($config_name, $sync_data);
 
     // Verify that the diff reflects a change.
-    $diff = \Drupal::service('config.manager')->diff($active, $staging, $config_name);
+    $diff = \Drupal::service('config.manager')->diff($active, $sync, $config_name);
     $edits = $diff->getEdits();
     $this->assertEqual($edits[0]->type, 'change', 'The first item in the diff is a change.');
     $this->assertEqual($edits[0]->orig[0], $change_key . ': ' . $original_data[$change_key], format_string("The active value for key '%change_key' is '%original_data'.", array('%change_key' => $change_key, '%original_data' => $original_data[$change_key])));
-    $this->assertEqual($edits[0]->closing[0], $change_key . ': ' . $change_data, format_string("The staging value for key '%change_key' is '%change_data'.", array('%change_key' => $change_key, '%change_data' => $change_data)));
+    $this->assertEqual($edits[0]->closing[0], $change_key . ': ' . $change_data, format_string("The sync value for key '%change_key' is '%change_data'.", array('%change_key' => $change_key, '%change_data' => $change_data)));
 
     // Reset data back to original, and remove a key
-    $staging_data = $original_data;
-    unset($staging_data[$remove_key]);
-    $staging->write($config_name, $staging_data);
+    $sync_data = $original_data;
+    unset($sync_data[$remove_key]);
+    $sync->write($config_name, $sync_data);
 
     // Verify that the diff reflects a removed key.
-    $diff = \Drupal::service('config.manager')->diff($active, $staging, $config_name);
+    $diff = \Drupal::service('config.manager')->diff($active, $sync, $config_name);
     $edits = $diff->getEdits();
     $this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
     $this->assertEqual($edits[1]->type, 'delete', 'The second item in the diff is a delete.');
     $this->assertEqual($edits[1]->orig[0], $remove_key . ': ' . $original_data[$remove_key], format_string("The active value for key '%remove_key' is '%original_data'.", array('%remove_key' => $remove_key, '%original_data' => $original_data[$remove_key])));
-    $this->assertFalse($edits[1]->closing, format_string("The key '%remove_key' does not exist in staging.", array('%remove_key' => $remove_key)));
+    $this->assertFalse($edits[1]->closing, format_string("The key '%remove_key' does not exist in sync.", array('%remove_key' => $remove_key)));
 
     // Reset data back to original and add a key
-    $staging_data = $original_data;
-    $staging_data[$add_key] = $add_data;
-    $staging->write($config_name, $staging_data);
+    $sync_data = $original_data;
+    $sync_data[$add_key] = $add_data;
+    $sync->write($config_name, $sync_data);
 
     // Verify that the diff reflects an added key.
-    $diff = \Drupal::service('config.manager')->diff($active, $staging, $config_name);
+    $diff = \Drupal::service('config.manager')->diff($active, $sync, $config_name);
     $edits = $diff->getEdits();
     $this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
     $this->assertEqual($edits[1]->type, 'add', 'The second item in the diff is an add.');
     $this->assertFalse($edits[1]->orig, format_string("The key '%add_key' does not exist in active.", array('%add_key' => $add_key)));
-    $this->assertEqual($edits[1]->closing[0], $add_key . ': ' . $add_data, format_string("The staging value for key '%add_key' is '%add_data'.", array('%add_key' => $add_key, '%add_data' => $add_data)));
+    $this->assertEqual($edits[1]->closing[0], $add_key . ': ' . $add_data, format_string("The sync value for key '%add_key' is '%add_data'.", array('%add_key' => $add_key, '%add_data' => $add_data)));
 
     // Test diffing a renamed config entity.
     $test_entity_id = $this->randomMachineName();
@@ -90,9 +90,9 @@ function testDiff() {
     ));
     $test_entity->save();
     $data = $active->read('config_test.dynamic.' . $test_entity_id);
-    $staging->write('config_test.dynamic.' . $test_entity_id, $data);
+    $sync->write('config_test.dynamic.' . $test_entity_id, $data);
     $config_name = 'config_test.dynamic.' . $test_entity_id;
-    $diff = \Drupal::service('config.manager')->diff($active, $staging, $config_name, $config_name);
+    $diff = \Drupal::service('config.manager')->diff($active, $sync, $config_name, $config_name);
     // Prove the fields match.
     $edits = $diff->getEdits();
     $this->assertEqual($edits[0]->type, 'copy',  'The first item in the diff is a copy.');
@@ -103,7 +103,7 @@ function testDiff() {
     $test_entity->set('id', $new_test_entity_id);
     $test_entity->save();
 
-    $diff = \Drupal::service('config.manager')->diff($active, $staging, 'config_test.dynamic.' . $new_test_entity_id, $config_name);
+    $diff = \Drupal::service('config.manager')->diff($active, $sync, 'config_test.dynamic.' . $new_test_entity_id, $config_name);
     $edits = $diff->getEdits();
     $this->assertEqual($edits[0]->type, 'copy',  'The first item in the diff is a copy.');
     $this->assertEqual($edits[1]->type, 'change',  'The second item in the diff is a change.');
@@ -119,27 +119,27 @@ function testDiff() {
   function testCollectionDiff() {
     /** @var \Drupal\Core\Config\StorageInterface $active */
     $active = $this->container->get('config.storage');
-    /** @var \Drupal\Core\Config\StorageInterface $staging */
-    $staging = $this->container->get('config.storage.staging');
+    /** @var \Drupal\Core\Config\StorageInterface $sync */
+    $sync = $this->container->get('config.storage.sync');
     $active_test_collection = $active->createCollection('test');
-    $staging_test_collection = $staging->createCollection('test');
+    $sync_test_collection = $sync->createCollection('test');
 
     $config_name = 'config_test.test';
     $data = array('foo' => 'bar');
 
     $active->write($config_name, $data);
-    $staging->write($config_name, $data);
+    $sync->write($config_name, $data);
     $active_test_collection->write($config_name, $data);
-    $staging_test_collection->write($config_name, array('foo' => 'baz'));
+    $sync_test_collection->write($config_name, array('foo' => 'baz'));
 
     // Test the fields match in the default collection diff.
-    $diff = \Drupal::service('config.manager')->diff($active, $staging, $config_name);
+    $diff = \Drupal::service('config.manager')->diff($active, $sync, $config_name);
     $edits = $diff->getEdits();
     $this->assertEqual($edits[0]->type, 'copy',  'The first item in the diff is a copy.');
     $this->assertEqual(count($edits), 1, 'There is one item in the diff');
 
     // Test that the differences are detected when diffing the collection.
-    $diff = \Drupal::service('config.manager')->diff($active, $staging, $config_name, NULL, 'test');
+    $diff = \Drupal::service('config.manager')->diff($active, $sync, $config_name, NULL, 'test');
     $edits = $diff->getEdits();
     $this->assertEqual($edits[0]->type, 'change',  'The second item in the diff is a copy.');
     $this->assertEqual($edits[0]->orig, array('foo: bar'));
diff --git a/core/modules/config/src/Tests/ConfigEntityStorageTest.php b/core/modules/config/src/Tests/ConfigEntityStorageTest.php
index 19bf95947cde..dea998b6a51a 100644
--- a/core/modules/config/src/Tests/ConfigEntityStorageTest.php
+++ b/core/modules/config/src/Tests/ConfigEntityStorageTest.php
@@ -11,7 +11,7 @@
 use Drupal\Core\Config\ConfigDuplicateUUIDException;
 
 /**
- * Tests staging and importing config entities with IDs and UUIDs that match
+ * Tests sync and importing config entities with IDs and UUIDs that match
  * existing config.
  *
  * @group config
diff --git a/core/modules/config/src/Tests/ConfigExportImportUITest.php b/core/modules/config/src/Tests/ConfigExportImportUITest.php
index 41183877ff1e..d72c718e8cdf 100644
--- a/core/modules/config/src/Tests/ConfigExportImportUITest.php
+++ b/core/modules/config/src/Tests/ConfigExportImportUITest.php
@@ -191,21 +191,21 @@ public function testExportImport() {
     // Ensure the item is displayed as part of a list (to avoid false matches
     // on the rest of the page) and that the list markup is not escaped.
     $this->assertRaw('<li>system.site</li>');
-    // Remove everything from staging. The warning about differences between the
+    // Remove everything from sync. The warning about differences between the
     // active and snapshot should no longer exist.
-    \Drupal::service('config.storage.staging')->deleteAll();
+    \Drupal::service('config.storage.sync')->deleteAll();
     $this->drupalGet('admin/config/development/configuration');
     $this->assertNoText(t('Warning message'));
     $this->assertNoText('The following items in your active configuration have changes since the last import that may be lost on the next import.');
     $this->assertText(t('There are no configuration changes to import.'));
-    // Write a file to staging. The warning about differences between the
-    // active and snapshot should now exist.
-    /** @var \Drupal\Core\Config\StorageInterface $staging */
-    $staging = $this->container->get('config.storage.staging');
+    // Write a file to sync. The warning about differences between the active
+    // and snapshot should now exist.
+    /** @var \Drupal\Core\Config\StorageInterface $sync */
+    $sync = $this->container->get('config.storage.sync');
     $data = $this->config('system.site')->get();
     $data['slogan'] = 'in the face';
-    $this->copyConfig($this->container->get('config.storage'), $staging);
-    $staging->write('system.site', $data);
+    $this->copyConfig($this->container->get('config.storage'), $sync);
+    $sync->write('system.site', $data);
     $this->drupalGet('admin/config/development/configuration');
     $this->assertText(t('Warning message'));
     $this->assertText('The following items in your active configuration have changes since the last import that may be lost on the next import.');
diff --git a/core/modules/config/src/Tests/ConfigFileContentTest.php b/core/modules/config/src/Tests/ConfigFileContentTest.php
index 2f7c5dbca402..186458fdde10 100644
--- a/core/modules/config/src/Tests/ConfigFileContentTest.php
+++ b/core/modules/config/src/Tests/ConfigFileContentTest.php
@@ -210,7 +210,7 @@ function testSerialization() {
     );
 
     // Encode and write, and reload and decode the configuration data.
-    $filestorage = new FileStorage($this->configDirectories[CONFIG_STAGING_DIRECTORY]);
+    $filestorage = new FileStorage($this->configDirectories[CONFIG_SYNC_DIRECTORY]);
     $filestorage->write($name, $config_data);
     $config_parsed = $filestorage->read($name);
 
diff --git a/core/modules/config/src/Tests/ConfigImportAllTest.php b/core/modules/config/src/Tests/ConfigImportAllTest.php
index 6e1aaea16e91..d49697375706 100644
--- a/core/modules/config/src/Tests/ConfigImportAllTest.php
+++ b/core/modules/config/src/Tests/ConfigImportAllTest.php
@@ -70,8 +70,8 @@ public function testInstallUninstall() {
       $this->assertModuleTablesExist($module);
     }
 
-    // Export active config to staging
-    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
+    // Export active config to sync.
+    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
 
     system_list_reset();
     $this->resetAll();
@@ -145,7 +145,7 @@ public function testInstallUninstall() {
 
     // Ensure that we have no configuration changes to import.
     $storage_comparer = new StorageComparer(
-      $this->container->get('config.storage.staging'),
+      $this->container->get('config.storage.sync'),
       $this->container->get('config.storage'),
       $this->container->get('config.manager')
     );
diff --git a/core/modules/config/src/Tests/ConfigImportInstallProfileTest.php b/core/modules/config/src/Tests/ConfigImportInstallProfileTest.php
index 64b2d5ddd315..19ef2eec08a7 100644
--- a/core/modules/config/src/Tests/ConfigImportInstallProfileTest.php
+++ b/core/modules/config/src/Tests/ConfigImportInstallProfileTest.php
@@ -42,7 +42,7 @@ protected function setUp() {
 
     $this->webUser = $this->drupalCreateUser(array('synchronize configuration'));
     $this->drupalLogin($this->webUser);
-    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
+    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
   }
 
   /**
@@ -51,13 +51,13 @@ protected function setUp() {
    * @see \Drupal\Core\EventSubscriber\ConfigImportSubscriber
    */
   public function testInstallProfileValidation() {
-    $staging = $this->container->get('config.storage.staging');
-    $this->copyConfig($this->container->get('config.storage'), $staging);
-    $core = $staging->read('core.extension');
+    $sync = $this->container->get('config.storage.sync');
+    $this->copyConfig($this->container->get('config.storage'), $sync);
+    $core = $sync->read('core.extension');
 
     // Ensure install profiles can not be uninstalled.
     unset($core['module']['testing_config_import']);
-    $staging->write('core.extension', $core);
+    $sync->write('core.extension', $core);
 
     $this->drupalPostForm('admin/config/development/configuration', array(), t('Import all'));
     $this->assertText('The configuration cannot be imported because it failed validation for the following reasons:');
@@ -68,11 +68,11 @@ public function testInstallProfileValidation() {
     unset($core['module']['syslog']);
     unset($core['theme']['stark']);
     $core['theme']['classy'] = 0;
-    $staging->write('core.extension', $core);
-    $staging->deleteAll('syslog.');
-    $theme = $staging->read('system.theme');
+    $sync->write('core.extension', $core);
+    $sync->deleteAll('syslog.');
+    $theme = $sync->read('system.theme');
     $theme['default'] = 'classy';
-    $staging->write('system.theme', $theme);
+    $sync->write('system.theme', $theme);
     $this->drupalPostForm('admin/config/development/configuration', array(), t('Import all'));
     $this->assertText('The configuration was imported successfully.');
     $this->rebuildContainer();
diff --git a/core/modules/config/src/Tests/ConfigImportRecreateTest.php b/core/modules/config/src/Tests/ConfigImportRecreateTest.php
index 83ea2ee35d1b..cc703a045e6a 100644
--- a/core/modules/config/src/Tests/ConfigImportRecreateTest.php
+++ b/core/modules/config/src/Tests/ConfigImportRecreateTest.php
@@ -40,11 +40,11 @@ protected function setUp() {
     $this->installEntitySchema('node');
     $this->installConfig(array('field', 'node'));
 
-    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
+    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
 
     // Set up the ConfigImporter object for testing.
     $storage_comparer = new StorageComparer(
-      $this->container->get('config.storage.staging'),
+      $this->container->get('config.storage.sync'),
       $this->container->get('config.storage'),
       $this->container->get('config.manager')
     );
@@ -71,11 +71,11 @@ public function testRecreateEntity() {
     node_add_body_field($content_type);
     /** @var \Drupal\Core\Config\StorageInterface $active */
     $active = $this->container->get('config.storage');
-    /** @var \Drupal\Core\Config\StorageInterface $staging */
-    $staging = $this->container->get('config.storage.staging');
+    /** @var \Drupal\Core\Config\StorageInterface $sync */
+    $sync = $this->container->get('config.storage.sync');
 
     $config_name = $content_type->getEntityType()->getConfigPrefix() . '.' . $content_type->id();
-    $this->copyConfig($active, $staging);
+    $this->copyConfig($active, $sync);
 
     // Delete the content type. This will also delete a field storage, a field,
     // an entity view display and an entity form display.
diff --git a/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php b/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php
index e0b6a70b3ca4..3e6193a49107 100644
--- a/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php
+++ b/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php
@@ -48,7 +48,7 @@ protected function setUp() {
 
     // Set up the ConfigImporter object for testing.
     $storage_comparer = new StorageComparer(
-      $this->container->get('config.storage.staging'),
+      $this->container->get('config.storage.sync'),
       $this->container->get('config.storage'),
       $this->container->get('config.manager')
     );
@@ -80,8 +80,8 @@ public function testRenameValidation() {
 
     // Stage the test entity and then delete it from the active storage.
     $active = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
-    $this->copyConfig($active, $staging);
+    $sync = $this->container->get('config.storage.sync');
+    $this->copyConfig($active, $sync);
     $test_entity->delete();
 
     // Create a content type with a matching UUID in the active storage.
@@ -127,8 +127,8 @@ public function testRenameSimpleConfigValidation() {
     $config->set('uuid', $uuid_value)->save();
 
     $active = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
-    $this->copyConfig($active, $staging);
+    $sync = $this->container->get('config.storage.sync');
+    $this->copyConfig($active, $sync);
     $config->delete();
 
     // Create another simple configuration with the same UUID.
diff --git a/core/modules/config/src/Tests/ConfigImportUITest.php b/core/modules/config/src/Tests/ConfigImportUITest.php
index 8c2e5bf29108..86d59eed9bef 100644
--- a/core/modules/config/src/Tests/ConfigImportUITest.php
+++ b/core/modules/config/src/Tests/ConfigImportUITest.php
@@ -38,7 +38,7 @@ protected function setUp() {
 
     $this->webUser = $this->drupalCreateUser(array('synchronize configuration'));
     $this->drupalLogin($this->webUser);
-    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
+    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
   }
 
   /**
@@ -47,8 +47,8 @@ protected function setUp() {
   function testImport() {
     $name = 'system.site';
     $dynamic_name = 'config_test.dynamic.new';
-    /** @var \Drupal\Core\Config\StorageInterface $staging */
-    $staging = $this->container->get('config.storage.staging');
+    /** @var \Drupal\Core\Config\StorageInterface $sync */
+    $sync = $this->container->get('config.storage.sync');
 
     $this->drupalGet('admin/config/development/configuration');
     $this->assertText('There are no configuration changes to import.');
@@ -57,7 +57,7 @@ function testImport() {
     // Create updated configuration object.
     $new_site_name = 'Config import test ' . $this->randomString();
     $this->prepareSiteNameUpdate($new_site_name);
-    $this->assertIdentical($staging->exists($name), TRUE, $name . ' found.');
+    $this->assertIdentical($sync->exists($name), TRUE, $name . ' found.');
 
     // Create new config entity.
     $original_dynamic_data = array(
@@ -73,8 +73,8 @@ function testImport() {
       'size_value' => '',
       'protected_property' => '',
     );
-    $staging->write($dynamic_name, $original_dynamic_data);
-    $this->assertIdentical($staging->exists($dynamic_name), TRUE, $dynamic_name . ' found.');
+    $sync->write($dynamic_name, $original_dynamic_data);
+    $this->assertIdentical($sync->exists($dynamic_name), TRUE, $dynamic_name . ' found.');
 
     // Enable the Action and Ban modules during import. The Ban
     // module is used because it creates a table during the install. The Action
@@ -87,7 +87,7 @@ function testImport() {
     // Bartik is a subtheme of classy so classy must be enabled.
     $core_extension['theme']['classy'] = 0;
     $core_extension['theme']['bartik'] = 0;
-    $staging->write('core.extension', $core_extension);
+    $sync->write('core.extension', $core_extension);
 
     // Use the install storage so that we can read configuration from modules
     // and themes that are not installed.
@@ -96,17 +96,17 @@ function testImport() {
     // Set the Bartik theme as default.
     $system_theme = $this->config('system.theme')->get();
     $system_theme['default'] = 'bartik';
-    $staging->write('system.theme', $system_theme);
+    $sync->write('system.theme', $system_theme);
 
     // Read the action config from module default config folder.
     $action_settings = $install_storage->read('action.settings');
     $action_settings['recursion_limit'] = 50;
-    $staging->write('action.settings', $action_settings);
+    $sync->write('action.settings', $action_settings);
 
     // Uninstall the Options and Text modules to ensure that dependencies are
     // handled correctly. Options depends on Text so Text should be installed
     // first. Since they were enabled during the test setup the core.extension
-    // file in staging will already contain them.
+    // file in sync will already contain them.
     \Drupal::service('module_installer')->uninstall(array('text', 'options'));
 
     // Set the state system to record installations and uninstallations.
@@ -175,14 +175,14 @@ function testImport() {
     unset($core_extension['module']['options']);
     unset($core_extension['module']['text']);
     unset($core_extension['theme']['bartik']);
-    $staging->write('core.extension', $core_extension);
-    $staging->delete('action.settings');
-    $staging->delete('text.settings');
+    $sync->write('core.extension', $core_extension);
+    $sync->delete('action.settings');
+    $sync->delete('text.settings');
 
     $system_theme = $this->config('system.theme')->get();
     $system_theme['default'] = 'stark';
     $system_theme['admin'] = 'stark';
-    $staging->write('system.theme', $system_theme);
+    $sync->write('system.theme', $system_theme);
 
     // Set the state system to record installations and uninstallations.
     \Drupal::state()->set('ConfigImportUITest.core.extension.modules_installed', array());
@@ -254,12 +254,12 @@ function testImportLock() {
    * Tests verification of site UUID before importing configuration.
    */
   function testImportSiteUuidValidation() {
-    $staging = \Drupal::service('config.storage.staging');
+    $sync = \Drupal::service('config.storage.sync');
     // Create updated configuration object.
     $config_data = $this->config('system.site')->get();
     // Generate a new site UUID.
     $config_data['uuid'] = \Drupal::service('uuid')->generate();
-    $staging->write('system.site', $config_data);
+    $sync->write('system.site', $config_data);
 
     // Verify that there are configuration differences to import.
     $this->drupalGet('admin/config/development/configuration');
@@ -268,10 +268,10 @@ function testImportSiteUuidValidation() {
   }
 
   /**
-   * Tests the screen that shows differences between active and staging.
+   * Tests the screen that shows differences between active and sync.
    */
   function testImportDiff() {
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
     $config_name = 'config_test.system';
     $change_key = 'foo';
     $remove_key = '404';
@@ -286,12 +286,12 @@ function testImportDiff() {
     // Update active storage to have html in config data.
     $this->config($config_name)->setData($original_data)->save();
 
-    // Change a configuration value in staging.
-    $staging_data = $original_data;
-    $staging_data[$change_key] = $change_data;
-    $staging_data[$add_key] = $add_data;
-    unset($staging_data[$remove_key]);
-    $staging->write($config_name, $staging_data);
+    // Change a configuration value in sync.
+    $sync_data = $original_data;
+    $sync_data[$change_key] = $change_data;
+    $sync_data[$add_key] = $add_data;
+    unset($sync_data[$remove_key]);
+    $sync->write($config_name, $sync_data);
 
     // Load the diff UI and verify that the diff reflects the change.
     $this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name);
@@ -312,9 +312,9 @@ function testImportDiff() {
     $this->assertText(Html::escape("404: '<em>herp</em>'"));
 
     // Reset data back to original, and remove a key
-    $staging_data = $original_data;
-    unset($staging_data[$remove_key]);
-    $staging->write($config_name, $staging_data);
+    $sync_data = $original_data;
+    unset($sync_data[$remove_key]);
+    $sync->write($config_name, $sync_data);
 
     // Load the diff UI and verify that the diff reflects a removed key.
     $this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name);
@@ -325,9 +325,9 @@ function testImportDiff() {
     $this->assertText(Html::escape("404: '<em>herp</em>'"));
 
     // Reset data back to original and add a key
-    $staging_data = $original_data;
-    $staging_data[$add_key] = $add_data;
-    $staging->write($config_name, $staging_data);
+    $sync_data = $original_data;
+    $sync_data[$add_key] = $add_data;
+    $sync->write($config_name, $sync_data);
 
     // Load the diff UI and verify that the diff reflects an added key.
     $this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name);
@@ -364,11 +364,11 @@ public function testImportValidation() {
   }
 
   public function testConfigUninstallConfigException() {
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
 
     $core_extension = $this->config('core.extension')->get();
     unset($core_extension['module']['config']);
-    $staging->write('core.extension', $core_extension);
+    $sync->write('core.extension', $core_extension);
 
     $this->drupalGet('admin/config/development/configuration');
     $this->assertText('core.extension');
@@ -379,11 +379,11 @@ public function testConfigUninstallConfigException() {
   }
 
   function prepareSiteNameUpdate($new_site_name) {
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
     // Create updated configuration object.
     $config_data = $this->config('system.site')->get();
     $config_data['name'] = $new_site_name;
-    $staging->write('system.site', $config_data);
+    $sync->write('system.site', $config_data);
   }
 
   /**
@@ -392,7 +392,7 @@ function prepareSiteNameUpdate($new_site_name) {
   function testImportErrorLog() {
     $name_primary = 'config_test.dynamic.primary';
     $name_secondary = 'config_test.dynamic.secondary';
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
     $uuid = $this->container->get('uuid');
 
     $values_primary = array(
@@ -408,7 +408,7 @@ function testImportErrorLog() {
       'size_value' => NULL,
       'protected_property' => NULL,
     );
-    $staging->write($name_primary, $values_primary);
+    $sync->write($name_primary, $values_primary);
     $values_secondary = array(
       'uuid' => $uuid->generate(),
       'langcode' => 'en',
@@ -425,7 +425,7 @@ function testImportErrorLog() {
       'size_value' => NULL,
       'protected_property' => NULL,
     );
-    $staging->write($name_secondary, $values_secondary);
+    $sync->write($name_secondary, $values_secondary);
     // Verify that there are configuration differences to import.
     $this->drupalGet('admin/config/development/configuration');
     $this->assertNoText(t('There are no configuration changes to import.'));
@@ -445,7 +445,7 @@ function testImportErrorLog() {
    */
   public function testEntityBundleDelete() {
     \Drupal::service('module_installer')->install(array('node'));
-    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
+    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
 
     $node_type = $this->drupalCreateContentType();
     $node = $this->drupalCreateNode(array('type' => $node_type->id()));
@@ -492,9 +492,9 @@ public function testExtensionValidation() {
     \Drupal::service('theme_handler')->install(['bartik']);
     $this->rebuildContainer();
 
-    $staging = $this->container->get('config.storage.staging');
-    $this->copyConfig($this->container->get('config.storage'), $staging);
-    $core = $staging->read('core.extension');
+    $sync = $this->container->get('config.storage.sync');
+    $this->copyConfig($this->container->get('config.storage'), $sync);
+    $core = $sync->read('core.extension');
     // Node depends on text.
     unset($core['module']['text']);
     $module_data = system_rebuild_module_data();
@@ -507,7 +507,7 @@ public function testExtensionValidation() {
     $core['module']['does_not_exist'] = 0;
     // This theme does not exist.
     $core['theme']['does_not_exist'] = 0;
-    $staging->write('core.extension', $core);
+    $sync->write('core.extension', $core);
 
     $this->drupalPostForm('admin/config/development/configuration', array(), t('Import all'));
     $this->assertText('The configuration cannot be imported because it failed validation for the following reasons:');
diff --git a/core/modules/config/src/Tests/ConfigImporterMissingContentTest.php b/core/modules/config/src/Tests/ConfigImporterMissingContentTest.php
index 26bc66bd2fbb..7990da3db550 100644
--- a/core/modules/config/src/Tests/ConfigImporterMissingContentTest.php
+++ b/core/modules/config/src/Tests/ConfigImporterMissingContentTest.php
@@ -45,11 +45,11 @@ protected function setUp() {
     // so it has to be cleared out manually.
     unset($GLOBALS['hook_config_test']);
 
-    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
+    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
 
     // Set up the ConfigImporter object for testing.
     $storage_comparer = new StorageComparer(
-      $this->container->get('config.storage.staging'),
+      $this->container->get('config.storage.sync'),
       $this->container->get('config.storage'),
       $this->container->get('config.manager')
     );
@@ -75,10 +75,10 @@ protected function setUp() {
   function testMissingContent() {
     \Drupal::state()->set('config_import_test.config_import_missing_content', TRUE);
 
-    // Update a configuration entity in the staging directory to have a
-    // dependency on two content entities that do not exist.
+    // Update a configuration entity in the sync directory to have a dependency
+    // on two content entities that do not exist.
     $storage = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
     $entity_one = entity_create('entity_test', array('name' => 'one'));
     $entity_two = entity_create('entity_test', array('name' => 'two'));
     $entity_three = entity_create('entity_test', array('name' => 'three'));
@@ -93,7 +93,7 @@ function testMissingContent() {
     // Entity three will be resolved by
     // \Drupal\Core\Config\Importer\FinalMissingContentSubscriber.
     $original_dynamic_data['dependencies']['content'][] = $entity_three->getConfigDependencyName();
-    $staging->write($dynamic_name, $original_dynamic_data);
+    $sync->write($dynamic_name, $original_dynamic_data);
 
     // Import.
     $this->configImporter->reset()->import();
diff --git a/core/modules/config/src/Tests/ConfigImporterTest.php b/core/modules/config/src/Tests/ConfigImporterTest.php
index 51fabae2c744..f932c811d72f 100644
--- a/core/modules/config/src/Tests/ConfigImporterTest.php
+++ b/core/modules/config/src/Tests/ConfigImporterTest.php
@@ -44,11 +44,11 @@ protected function setUp() {
     // so it has to be cleared out manually.
     unset($GLOBALS['hook_config_test']);
 
-    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
+    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
 
     // Set up the ConfigImporter object for testing.
     $storage_comparer = new StorageComparer(
-      $this->container->get('config.storage.staging'),
+      $this->container->get('config.storage.sync'),
       $this->container->get('config.storage'),
       $this->container->get('config.manager')
     );
@@ -80,12 +80,12 @@ function testNoImport() {
   }
 
   /**
-   * Tests that trying to import from an empty staging configuration directory
+   * Tests that trying to import from an empty sync configuration directory
    * fails.
    */
   function testEmptyImportFails() {
     try {
-      $this->container->get('config.storage.staging')->deleteAll();
+      $this->container->get('config.storage.sync')->deleteAll();
       $this->configImporter->reset()->import();
       $this->fail('ConfigImporterException thrown, successfully stopping an empty import.');
     }
@@ -98,12 +98,12 @@ function testEmptyImportFails() {
    * Tests verification of site UUID before importing configuration.
    */
   function testSiteUuidValidate() {
-    $staging = \Drupal::service('config.storage.staging');
+    $sync = \Drupal::service('config.storage.sync');
     // Create updated configuration object.
     $config_data = $this->config('system.site')->get();
     // Generate a new site UUID.
     $config_data['uuid'] = \Drupal::service('uuid')->generate();
-    $staging->write('system.site', $config_data);
+    $sync->write('system.site', $config_data);
     try {
       $this->configImporter->reset()->import();
       $this->fail('ConfigImporterException not thrown, invalid import was not stopped due to mis-matching site UUID.');
@@ -122,14 +122,14 @@ function testSiteUuidValidate() {
   function testDeleted() {
     $dynamic_name = 'config_test.dynamic.dotted.default';
     $storage = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
 
     // Verify the default configuration values exist.
     $config = $this->config($dynamic_name);
     $this->assertIdentical($config->get('id'), 'dotted.default');
 
-    // Delete the file from the staging directory.
-    $staging->delete($dynamic_name);
+    // Delete the file from the sync directory.
+    $sync->delete($dynamic_name);
 
     // Import.
     $this->configImporter->reset()->import();
@@ -159,7 +159,7 @@ function testDeleted() {
   function testNew() {
     $dynamic_name = 'config_test.dynamic.new';
     $storage = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
 
     // Verify the configuration to create does not exist yet.
     $this->assertIdentical($storage->exists($dynamic_name), FALSE, $dynamic_name . ' not found.');
@@ -178,9 +178,9 @@ function testNew() {
       'size_value' => '',
       'protected_property' => '',
     );
-    $staging->write($dynamic_name, $original_dynamic_data);
+    $sync->write($dynamic_name, $original_dynamic_data);
 
-    $this->assertIdentical($staging->exists($dynamic_name), TRUE, $dynamic_name . ' found.');
+    $this->assertIdentical($sync->exists($dynamic_name), TRUE, $dynamic_name . ' found.');
 
     // Import.
     $this->configImporter->reset()->import();
@@ -213,7 +213,7 @@ function testNew() {
   function testSecondaryWritePrimaryFirst() {
     $name_primary = 'config_test.dynamic.primary';
     $name_secondary = 'config_test.dynamic.secondary';
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
     $uuid = $this->container->get('uuid');
 
     $values_primary = array(
@@ -222,7 +222,7 @@ function testSecondaryWritePrimaryFirst() {
       'weight' => 0,
       'uuid' => $uuid->generate(),
     );
-    $staging->write($name_primary, $values_primary);
+    $sync->write($name_primary, $values_primary);
     $values_secondary = array(
       'id' => 'secondary',
       'label' => 'Secondary Sync',
@@ -233,7 +233,7 @@ function testSecondaryWritePrimaryFirst() {
         'config' => array($name_primary),
       )
     );
-    $staging->write($name_secondary, $values_secondary);
+    $sync->write($name_secondary, $values_secondary);
 
     // Import.
     $this->configImporter->reset()->import();
@@ -259,7 +259,7 @@ function testSecondaryWritePrimaryFirst() {
   function testSecondaryWriteSecondaryFirst() {
     $name_primary = 'config_test.dynamic.primary';
     $name_secondary = 'config_test.dynamic.secondary';
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
     $uuid = $this->container->get('uuid');
 
     $values_primary = array(
@@ -272,14 +272,14 @@ function testSecondaryWriteSecondaryFirst() {
         'config' => array($name_secondary),
       )
     );
-    $staging->write($name_primary, $values_primary);
+    $sync->write($name_primary, $values_primary);
     $values_secondary = array(
       'id' => 'secondary',
       'label' => 'Secondary Sync',
       'weight' => 0,
       'uuid' => $uuid->generate(),
     );
-    $staging->write($name_secondary, $values_secondary);
+    $sync->write($name_secondary, $values_secondary);
 
     // Import.
     $this->configImporter->reset()->import();
@@ -307,7 +307,7 @@ function testSecondaryUpdateDeletedDeleterFirst() {
     $name_deletee = 'config_test.dynamic.deletee';
     $name_other = 'config_test.dynamic.other';
     $storage = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
     $uuid = $this->container->get('uuid');
 
     $values_deleter = array(
@@ -318,7 +318,7 @@ function testSecondaryUpdateDeletedDeleterFirst() {
     );
     $storage->write($name_deleter, $values_deleter);
     $values_deleter['label'] = 'Updated Deleter';
-    $staging->write($name_deleter, $values_deleter);
+    $sync->write($name_deleter, $values_deleter);
     $values_deletee = array(
       'id' => 'deletee',
       'label' => 'Deletee',
@@ -331,7 +331,7 @@ function testSecondaryUpdateDeletedDeleterFirst() {
     );
     $storage->write($name_deletee, $values_deletee);
     $values_deletee['label'] = 'Updated Deletee';
-    $staging->write($name_deletee, $values_deletee);
+    $sync->write($name_deletee, $values_deletee);
 
     // Ensure that import will continue after the error.
     $values_other = array(
@@ -347,7 +347,7 @@ function testSecondaryUpdateDeletedDeleterFirst() {
     );
     $storage->write($name_other, $values_other);
     $values_other['label'] = 'Updated other';
-    $staging->write($name_other, $values_other);
+    $sync->write($name_other, $values_other);
 
     // Check update changelist order.
     $updates = $this->configImporter->reset()->getStorageComparer()->getChangelist('update');
@@ -392,7 +392,7 @@ function testSecondaryUpdateDeletedDeleteeFirst() {
     $name_deleter = 'config_test.dynamic.deleter';
     $name_deletee = 'config_test.dynamic.deletee';
     $storage = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
     $uuid = $this->container->get('uuid');
 
     $values_deleter = array(
@@ -407,7 +407,7 @@ function testSecondaryUpdateDeletedDeleteeFirst() {
     );
     $storage->write($name_deleter, $values_deleter);
     $values_deleter['label'] = 'Updated Deleter';
-    $staging->write($name_deleter, $values_deleter);
+    $sync->write($name_deleter, $values_deleter);
     $values_deletee = array(
       'id' => 'deletee',
       'label' => 'Deletee',
@@ -416,7 +416,7 @@ function testSecondaryUpdateDeletedDeleteeFirst() {
     );
     $storage->write($name_deletee, $values_deletee);
     $values_deletee['label'] = 'Updated Deletee';
-    $staging->write($name_deletee, $values_deletee);
+    $sync->write($name_deletee, $values_deletee);
 
     // Import.
     $this->configImporter->reset()->import();
@@ -480,21 +480,21 @@ function testUpdated() {
     $name = 'config_test.system';
     $dynamic_name = 'config_test.dynamic.dotted.default';
     $storage = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
 
     // Verify that the configuration objects to import exist.
     $this->assertIdentical($storage->exists($name), TRUE, $name . ' found.');
     $this->assertIdentical($storage->exists($dynamic_name), TRUE, $dynamic_name . ' found.');
 
     // Replace the file content of the existing configuration objects in the
-    // staging directory.
+    // sync directory.
     $original_name_data = array(
       'foo' => 'beer',
     );
-    $staging->write($name, $original_name_data);
+    $sync->write($name, $original_name_data);
     $original_dynamic_data = $storage->read($dynamic_name);
     $original_dynamic_data['label'] = 'Updated';
-    $staging->write($dynamic_name, $original_dynamic_data);
+    $sync->write($dynamic_name, $original_dynamic_data);
 
     // Verify the active configuration still returns the default values.
     $config = $this->config($name);
@@ -513,8 +513,8 @@ function testUpdated() {
     $this->assertIdentical($config->get('label'), 'Updated');
 
     // Verify that the original file content is still the same.
-    $this->assertIdentical($staging->read($name), $original_name_data);
-    $this->assertIdentical($staging->read($dynamic_name), $original_dynamic_data);
+    $this->assertIdentical($sync->read($name), $original_name_data);
+    $this->assertIdentical($sync->read($dynamic_name), $original_dynamic_data);
 
     // Verify that appropriate module API hooks have been invoked.
     $this->assertTrue(isset($GLOBALS['hook_config_test']['load']));
@@ -549,29 +549,29 @@ function testIsInstallable() {
    */
   public function testUnmetDependency() {
     $storage = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
 
     // Test an unknown configuration owner.
-    $staging->write('unknown.config', ['test' => 'test']);
+    $sync->write('unknown.config', ['test' => 'test']);
 
     // Make a config entity have unmet dependencies.
-    $config_entity_data = $staging->read('config_test.dynamic.dotted.default');
+    $config_entity_data = $sync->read('config_test.dynamic.dotted.default');
     $config_entity_data['dependencies'] = ['module' => ['unknown']];
-    $staging->write('config_test.dynamic.dotted.module', $config_entity_data);
+    $sync->write('config_test.dynamic.dotted.module', $config_entity_data);
     $config_entity_data['dependencies'] = ['theme' => ['unknown']];
-    $staging->write('config_test.dynamic.dotted.theme', $config_entity_data);
+    $sync->write('config_test.dynamic.dotted.theme', $config_entity_data);
     $config_entity_data['dependencies'] = ['config' => ['unknown']];
-    $staging->write('config_test.dynamic.dotted.config', $config_entity_data);
+    $sync->write('config_test.dynamic.dotted.config', $config_entity_data);
 
-    // Make an active config depend on something that is missing in staging.
+    // Make an active config depend on something that is missing in sync.
     // The whole configuration needs to be consistent, not only the updated one.
     $config_entity_data['dependencies'] = [];
     $storage->write('config_test.dynamic.dotted.deleted', $config_entity_data);
     $config_entity_data['dependencies'] = ['config' => ['config_test.dynamic.dotted.deleted']];
     $storage->write('config_test.dynamic.dotted.existing', $config_entity_data);
-    $staging->write('config_test.dynamic.dotted.existing', $config_entity_data);
+    $sync->write('config_test.dynamic.dotted.existing', $config_entity_data);
 
-    $extensions = $staging->read('core.extension');
+    $extensions = $sync->read('core.extension');
     // Add a module and a theme that do not exist.
     $extensions['module']['unknown_module'] = 0;
     $extensions['theme']['unknown_theme'] = 0;
@@ -579,7 +579,7 @@ public function testUnmetDependency() {
     $extensions['module']['book'] = 0;
     $extensions['theme']['bartik'] = 0;
 
-    $staging->write('core.extension', $extensions);
+    $sync->write('core.extension', $extensions);
     try {
       $this->configImporter->reset()->import();
       $this->fail('ConfigImporterException not thrown; an invalid import was not stopped due to missing dependencies.');
@@ -604,13 +604,13 @@ public function testUnmetDependency() {
     }
 
     // Make a config entity have mulitple unmet dependencies.
-    $config_entity_data = $staging->read('config_test.dynamic.dotted.default');
+    $config_entity_data = $sync->read('config_test.dynamic.dotted.default');
     $config_entity_data['dependencies'] = ['module' => ['unknown', 'dblog']];
-    $staging->write('config_test.dynamic.dotted.module', $config_entity_data);
+    $sync->write('config_test.dynamic.dotted.module', $config_entity_data);
     $config_entity_data['dependencies'] = ['theme' => ['unknown', 'seven']];
-    $staging->write('config_test.dynamic.dotted.theme', $config_entity_data);
+    $sync->write('config_test.dynamic.dotted.theme', $config_entity_data);
     $config_entity_data['dependencies'] = ['config' => ['unknown', 'unknown2']];
-    $staging->write('config_test.dynamic.dotted.config', $config_entity_data);
+    $sync->write('config_test.dynamic.dotted.config', $config_entity_data);
     try {
       $this->configImporter->reset()->import();
       $this->fail('ConfigImporterException not thrown, invalid import was not stopped due to missing dependencies.');
@@ -635,8 +635,8 @@ public function testUnmetDependency() {
    * @see \Drupal\Core\EventSubscriber\ConfigImportSubscriber
    */
   public function testMissingCoreExtension() {
-    $staging = $this->container->get('config.storage.staging');
-    $staging->delete('core.extension');
+    $sync = $this->container->get('config.storage.sync');
+    $sync->delete('core.extension');
     try {
       $this->configImporter->reset()->import();
       $this->fail('ConfigImporterException not thrown, invalid import was not stopped due to missing dependencies.');
@@ -654,13 +654,13 @@ public function testMissingCoreExtension() {
    * @see \Drupal\Core\EventSubscriber\ConfigImportSubscriber
    */
   public function testInstallProfile() {
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
 
-    $extensions = $staging->read('core.extension');
+    $extensions = $sync->read('core.extension');
     // Add an install profile.
     $extensions['module']['standard'] = 0;
 
-    $staging->write('core.extension', $extensions);
+    $sync->write('core.extension', $extensions);
     try {
       $this->configImporter->reset()->import();
       $this->fail('ConfigImporterException not thrown; an invalid import was not stopped due to missing dependencies.');
@@ -677,8 +677,8 @@ public function testInstallProfile() {
    * Tests config_get_config_directory().
    */
   public function testConfigGetConfigDirectory() {
-    $directory = config_get_config_directory(CONFIG_STAGING_DIRECTORY);
-    $this->assertEqual($this->configDirectories[CONFIG_STAGING_DIRECTORY], $directory);
+    $directory = config_get_config_directory(CONFIG_SYNC_DIRECTORY);
+    $this->assertEqual($this->configDirectories[CONFIG_SYNC_DIRECTORY], $directory);
 
     $message = 'Calling config_get_config_directory() with CONFIG_ACTIVE_DIRECTORY results in an exception.';
     try {
diff --git a/core/modules/config/src/Tests/ConfigOverrideTest.php b/core/modules/config/src/Tests/ConfigOverrideTest.php
index 065d6fa5a9f9..4b2e9087ff0f 100644
--- a/core/modules/config/src/Tests/ConfigOverrideTest.php
+++ b/core/modules/config/src/Tests/ConfigOverrideTest.php
@@ -25,7 +25,7 @@ class ConfigOverrideTest extends KernelTestBase {
 
   protected function setUp() {
     parent::setUp();
-    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
+    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
   }
 
   /**
@@ -93,15 +93,15 @@ function testConfOverride() {
     $this->assertIdentical($config->getOriginal('baz', FALSE), $expected_original_data['baz']);
     $this->assertIdentical($config->getOriginal('404', FALSE), $expected_original_data['404']);
 
-    // Write file to staging.
-    $staging = $this->container->get('config.storage.staging');
+    // Write file to sync.
+    $sync = $this->container->get('config.storage.sync');
     $expected_new_data = array(
       'foo' => 'barbar',
       '404' => 'herpderp',
     );
-    $staging->write('config_test.system', $expected_new_data);
+    $sync->write('config_test.system', $expected_new_data);
 
-    // Import changed data from staging to active.
+    // Import changed data from sync to active.
     $this->configImporter()->import();
     $data = $active->read('config_test.system');
 
diff --git a/core/modules/config/src/Tests/ConfigSnapshotTest.php b/core/modules/config/src/Tests/ConfigSnapshotTest.php
index d42582a2ebc7..cbb67b73bc33 100644
--- a/core/modules/config/src/Tests/ConfigSnapshotTest.php
+++ b/core/modules/config/src/Tests/ConfigSnapshotTest.php
@@ -32,7 +32,7 @@ protected function setUp() {
     // Update the config snapshot. This allows the parent::setUp() to write
     // configuration files.
     \Drupal::service('config.manager')->createSnapshot(\Drupal::service('config.storage'), \Drupal::service('config.storage.snapshot'));
-    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
+    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
   }
 
   /**
@@ -40,7 +40,7 @@ protected function setUp() {
    */
   function testSnapshot() {
     $active = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
     $snapshot = $this->container->get('config.storage.snapshot');
     $config_manager = $this->container->get('config.manager');
     $config_name = 'config_test.system';
@@ -48,7 +48,7 @@ function testSnapshot() {
     $new_data = 'foobar';
 
     $active_snapshot_comparer = new StorageComparer($active, $snapshot, $config_manager);
-    $staging_snapshot_comparer = new StorageComparer($staging, $snapshot, $config_manager);
+    $sync_snapshot_comparer = new StorageComparer($sync, $snapshot, $config_manager);
 
     // Verify that we have an initial snapshot that matches the active
     // configuration. This has to be true as no config should be installed.
@@ -66,17 +66,17 @@ function testSnapshot() {
     // objects.
     $this->assertFalse($active_snapshot_comparer->reset()->hasChanges());
 
-    // Change a configuration value in staging.
-    $staging_data = $this->config($config_name)->get();
-    $staging_data[$config_key] = $new_data;
-    $staging->write($config_name, $staging_data);
+    // Change a configuration value in sync.
+    $sync_data = $this->config($config_name)->get();
+    $sync_data[$config_key] = $new_data;
+    $sync->write($config_name, $sync_data);
 
-    // Verify that active and snapshot match, and that staging doesn't match
+    // Verify that active and snapshot match, and that sync doesn't match
     // active.
     $this->assertFalse($active_snapshot_comparer->reset()->hasChanges());
-    $this->assertTrue($staging_snapshot_comparer->createChangelist()->hasChanges());
+    $this->assertTrue($sync_snapshot_comparer->createChangelist()->hasChanges());
 
-    // Import changed data from staging to active.
+    // Import changed data from sync to active.
     $this->configImporter()->import();
 
     // Verify changed config was properly imported.
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationConfigImportTest.php b/core/modules/content_translation/src/Tests/ContentTranslationConfigImportTest.php
index c06fdb26dcad..9d3450c20f12 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationConfigImportTest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationConfigImportTest.php
@@ -39,11 +39,11 @@ protected function setUp() {
     parent::setUp();
 
     $this->installEntitySchema('entity_test_mul');
-    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
+    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
 
     // Set up the ConfigImporter object for testing.
     $storage_comparer = new StorageComparer(
-      $this->container->get('config.storage.staging'),
+      $this->container->get('config.storage.sync'),
       $this->container->get('config.storage'),
       $this->container->get('config.manager')
     );
@@ -68,7 +68,7 @@ function testConfigImportUpdates() {
     $config_id = $entity_type_id . '.' . $entity_type_id;
     $config_name = 'language.content_settings.' . $config_id;
     $storage = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
+    $sync = $this->container->get('config.storage.sync');
 
     // Verify the configuration to create does not exist yet.
     $this->assertIdentical($storage->exists($config_name), FALSE, $config_name . ' not found.');
@@ -90,8 +90,8 @@ function testConfigImportUpdates() {
         'content_translation' => array('enabled' => TRUE),
       ),
     );
-    $staging->write($config_name, $data);
-    $this->assertIdentical($staging->exists($config_name), TRUE, $config_name . ' found.');
+    $sync->write($config_name, $data);
+    $this->assertIdentical($sync->exists($config_name), TRUE, $config_name . ' found.');
 
     // Import.
     $this->configImporter->reset()->import();
diff --git a/core/modules/field/src/Tests/FieldImportChangeTest.php b/core/modules/field/src/Tests/FieldImportChangeTest.php
index c34ff3126edc..8cf3f9c024da 100644
--- a/core/modules/field/src/Tests/FieldImportChangeTest.php
+++ b/core/modules/field/src/Tests/FieldImportChangeTest.php
@@ -37,16 +37,16 @@ function testImportChange() {
     $field_config_name = "field.field.$field_id";
 
     $active = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
-    $this->copyConfig($active, $staging);
+    $sync = $this->container->get('config.storage.sync');
+    $this->copyConfig($active, $sync);
 
-    // Save as files in the staging directory.
+    // Save as files in the sync directory.
     $field = $active->read($field_config_name);
     $new_label = 'Test update import field';
     $field['label'] = $new_label;
-    $staging->write($field_config_name, $field);
+    $sync->write($field_config_name, $field);
 
-    // Import the content of the staging directory.
+    // Import the content of the sync directory.
     $this->configImporter()->import();
 
     // Check that the updated config was correctly imported.
diff --git a/core/modules/field/src/Tests/FieldImportCreateTest.php b/core/modules/field/src/Tests/FieldImportCreateTest.php
index 0d465660b331..82cb9627e7a3 100644
--- a/core/modules/field/src/Tests/FieldImportCreateTest.php
+++ b/core/modules/field/src/Tests/FieldImportCreateTest.php
@@ -77,14 +77,14 @@ function testImportCreateDefault() {
    */
   function testImportCreate() {
     // A field storage with one single field.
-    $field_name = 'field_test_import_staging';
+    $field_name = 'field_test_import_sync';
     $field_storage_id = "entity_test.$field_name";
     $field_id = "entity_test.entity_test.$field_name";
     $field_storage_config_name = "field.storage.$field_storage_id";
     $field_config_name = "field.field.$field_id";
 
     // A field storage with two fields.
-    $field_name_2 = 'field_test_import_staging_2';
+    $field_name_2 = 'field_test_import_sync_2';
     $field_storage_id_2 = "entity_test.$field_name_2";
     $field_id_2a = "entity_test.test_bundle.$field_name_2";
     $field_id_2b = "entity_test.test_bundle_2.$field_name_2";
@@ -93,32 +93,32 @@ function testImportCreate() {
     $field_config_name_2b = "field.field.$field_id_2b";
 
     $active = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
-    $this->copyConfig($active, $staging);
+    $sync = $this->container->get('config.storage.sync');
+    $this->copyConfig($active, $sync);
 
-    // Add the new files to the staging directory.
-    $src_dir = drupal_get_path('module', 'field_test_config') . '/staging';
-    $target_dir = $this->configDirectories[CONFIG_STAGING_DIRECTORY];
+    // Add the new files to the sync directory.
+    $src_dir = drupal_get_path('module', 'field_test_config') . '/sync';
+    $target_dir = $this->configDirectories[CONFIG_SYNC_DIRECTORY];
     $this->assertTrue(file_unmanaged_copy("$src_dir/$field_storage_config_name.yml", "$target_dir/$field_storage_config_name.yml"));
     $this->assertTrue(file_unmanaged_copy("$src_dir/$field_config_name.yml", "$target_dir/$field_config_name.yml"));
     $this->assertTrue(file_unmanaged_copy("$src_dir/$field_storage_config_name_2.yml", "$target_dir/$field_storage_config_name_2.yml"));
     $this->assertTrue(file_unmanaged_copy("$src_dir/$field_config_name_2a.yml", "$target_dir/$field_config_name_2a.yml"));
     $this->assertTrue(file_unmanaged_copy("$src_dir/$field_config_name_2b.yml", "$target_dir/$field_config_name_2b.yml"));
 
-    // Import the content of the staging directory.
+    // Import the content of the sync directory.
     $this->configImporter()->import();
 
     // Check that the field and storage were created.
     $field_storage = FieldStorageConfig::load($field_storage_id);
-    $this->assertTrue($field_storage, 'Test import storage field from staging exists');
+    $this->assertTrue($field_storage, 'Test import storage field from sync exists');
     $field = FieldConfig::load($field_id);
-    $this->assertTrue($field, 'Test import field  from staging exists');
+    $this->assertTrue($field, 'Test import field  from sync exists');
     $field_storage = FieldStorageConfig::load($field_storage_id_2);
-    $this->assertTrue($field_storage, 'Test import storage field 2 from staging exists');
+    $this->assertTrue($field_storage, 'Test import storage field 2 from sync exists');
     $field = FieldConfig::load($field_id_2a);
-    $this->assertTrue($field, 'Test import field 2a from staging exists');
+    $this->assertTrue($field, 'Test import field 2a from sync exists');
     $field = FieldConfig::load($field_id_2b);
-    $this->assertTrue($field, 'Test import field 2b from staging exists');
+    $this->assertTrue($field, 'Test import field 2b from sync exists');
   }
 }
 
diff --git a/core/modules/field/src/Tests/FieldImportDeleteTest.php b/core/modules/field/src/Tests/FieldImportDeleteTest.php
index d4ffb05ae67e..279be69cae8a 100644
--- a/core/modules/field/src/Tests/FieldImportDeleteTest.php
+++ b/core/modules/field/src/Tests/FieldImportDeleteTest.php
@@ -63,18 +63,18 @@ public function testImportDelete() {
     $field_storage_uuid_2 = FieldStorageConfig::load($field_storage_id_2)->uuid();
 
     $active = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
-    $this->copyConfig($active, $staging);
-    $this->assertTrue($staging->delete($field_storage_config_name), SafeMarkup::format('Deleted field storage: @field_storage', array('@field_storage' => $field_storage_config_name)));
-    $this->assertTrue($staging->delete($field_storage_config_name_2), SafeMarkup::format('Deleted field storage: @field_storage', array('@field_storage' => $field_storage_config_name_2)));
-    $this->assertTrue($staging->delete($field_config_name), SafeMarkup::format('Deleted field: @field', array('@field' => $field_config_name)));
-    $this->assertTrue($staging->delete($field_config_name_2a), SafeMarkup::format('Deleted field: @field', array('@field' => $field_config_name_2a)));
-    $this->assertTrue($staging->delete($field_config_name_2b), SafeMarkup::format('Deleted field: @field', array('@field' => $field_config_name_2b)));
+    $sync = $this->container->get('config.storage.sync');
+    $this->copyConfig($active, $sync);
+    $this->assertTrue($sync->delete($field_storage_config_name), SafeMarkup::format('Deleted field storage: @field_storage', array('@field_storage' => $field_storage_config_name)));
+    $this->assertTrue($sync->delete($field_storage_config_name_2), SafeMarkup::format('Deleted field storage: @field_storage', array('@field_storage' => $field_storage_config_name_2)));
+    $this->assertTrue($sync->delete($field_config_name), SafeMarkup::format('Deleted field: @field', array('@field' => $field_config_name)));
+    $this->assertTrue($sync->delete($field_config_name_2a), SafeMarkup::format('Deleted field: @field', array('@field' => $field_config_name_2a)));
+    $this->assertTrue($sync->delete($field_config_name_2b), SafeMarkup::format('Deleted field: @field', array('@field' => $field_config_name_2b)));
 
     $deletes = $this->configImporter()->getUnprocessedConfiguration('delete');
     $this->assertEqual(count($deletes), 5, 'Importing configuration will delete 3 fields and 2 field storages.');
 
-    // Import the content of the staging directory.
+    // Import the content of the sync directory.
     $this->configImporter()->import();
 
     // Check that the field storages and fields are gone.
diff --git a/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php b/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php
index cf1ad8c3e380..b5b2d1576ee9 100644
--- a/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php
+++ b/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php
@@ -81,17 +81,17 @@ public function testImportDeleteUninstall() {
     $unrelated_field_storage->delete();
 
     $active = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
-    $this->copyConfig($active, $staging);
+    $sync = $this->container->get('config.storage.sync');
+    $this->copyConfig($active, $sync);
 
     // Stage uninstall of the Telephone module.
     $core_extension = $this->config('core.extension')->get();
     unset($core_extension['module']['telephone']);
-    $staging->write('core.extension', $core_extension);
+    $sync->write('core.extension', $core_extension);
 
     // Stage the field deletion
-    $staging->delete('field.storage.entity_test.field_test');
-    $staging->delete('field.field.entity_test.entity_test.field_test');
+    $sync->delete('field.storage.entity_test.field_test');
+    $sync->delete('field.field.entity_test.entity_test.field_test');
 
     $steps = $this->configImporter()->initialize();
     $this->assertIdentical($steps[0], array('\Drupal\field\ConfigImporterFieldPurger', 'process'), 'The additional process configuration synchronization step has been added.');
@@ -143,13 +143,13 @@ public function testImportAlreadyDeletedUninstall() {
     $field_storage->delete();
 
     $active = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
-    $this->copyConfig($active, $staging);
+    $sync = $this->container->get('config.storage.sync');
+    $this->copyConfig($active, $sync);
 
     // Stage uninstall of the Telephone module.
     $core_extension = $this->config('core.extension')->get();
     unset($core_extension['module']['telephone']);
-    $staging->write('core.extension', $core_extension);
+    $sync->write('core.extension', $core_extension);
 
     $deleted_storages = \Drupal::state()->get('field.storage.deleted') ?: array();
     $this->assertTrue(isset($deleted_storages[$field_storage_uuid]), 'Field has been deleted and needs purging before configuration synchronization.');
diff --git a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
index de793dd38561..58766e88af8e 100644
--- a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
+++ b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
@@ -79,17 +79,17 @@ public function testImportDeleteUninstall() {
     $this->assertEqual($entity->field_tel[0]->value, $value);
 
     $active = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
-    $this->copyConfig($active, $staging);
+    $sync = $this->container->get('config.storage.sync');
+    $this->copyConfig($active, $sync);
 
     // Stage uninstall of the Telephone module.
     $core_extension = $this->config('core.extension')->get();
     unset($core_extension['module']['telephone']);
-    $staging->write('core.extension', $core_extension);
+    $sync->write('core.extension', $core_extension);
 
     // Stage the field deletion
-    $staging->delete('field.storage.entity_test.field_tel');
-    $staging->delete('field.field.entity_test.entity_test.field_tel');
+    $sync->delete('field.storage.entity_test.field_tel');
+    $sync->delete('field.field.entity_test.entity_test.field_tel');
     $this->drupalGet('admin/config/development/configuration');
     // Test that the message for one field being purged during a configuration
     // synchronization is correct.
@@ -98,7 +98,7 @@ public function testImportDeleteUninstall() {
     // Stage an uninstall of the datetime module to test the message for
     // multiple fields.
     unset($core_extension['module']['datetime']);
-    $staging->write('core.extension', $core_extension);
+    $sync->write('core.extension', $core_extension);
 
     $this->drupalGet('admin/config/development/configuration');
     $this->assertText('This synchronization will delete data from the fields: entity_test.field_tel, entity_test.field_date.');
diff --git a/core/modules/field/tests/modules/field_test_config/staging/field.field.entity_test.entity_test.field_test_import_staging.yml b/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.entity_test.field_test_import_sync.yml
similarity index 56%
rename from core/modules/field/tests/modules/field_test_config/staging/field.field.entity_test.entity_test.field_test_import_staging.yml
rename to core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.entity_test.field_test_import_sync.yml
index 0bf637cb1fdc..678c9fa19a96 100644
--- a/core/modules/field/tests/modules/field_test_config/staging/field.field.entity_test.entity_test.field_test_import_staging.yml
+++ b/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.entity_test.field_test_import_sync.yml
@@ -1,10 +1,10 @@
-id: entity_test.entity_test.field_test_import_staging
+id: entity_test.entity_test.field_test_import_sync
 uuid: ea711065-6940-47cd-813d-618f64095481
 langcode: en
-field_name: field_test_import_staging
+field_name: field_test_import_sync
 entity_type: entity_test
 bundle: entity_test
-label: 'Import from staging'
+label: 'Import from sync'
 description: ''
 required: '0'
 default_value: {  }
@@ -13,4 +13,4 @@ settings: { }
 field_type: text
 dependencies:
   config:
-    - field.storage.entity_test.field_test_import_staging
+    - field.storage.entity_test.field_test_import_sync
diff --git a/core/modules/field/tests/modules/field_test_config/staging/field.field.entity_test.test_bundle.field_test_import_staging_2.yml b/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle.field_test_import_sync_2.yml
similarity index 63%
rename from core/modules/field/tests/modules/field_test_config/staging/field.field.entity_test.test_bundle.field_test_import_staging_2.yml
rename to core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle.field_test_import_sync_2.yml
index 1e77c84a190d..e483418f9374 100644
--- a/core/modules/field/tests/modules/field_test_config/staging/field.field.entity_test.test_bundle.field_test_import_staging_2.yml
+++ b/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle.field_test_import_sync_2.yml
@@ -1,7 +1,7 @@
-id: entity_test.test_bundle.field_test_import_staging_2
+id: entity_test.test_bundle.field_test_import_sync_2
 uuid: f07794a2-d7cc-45b6-b40d-13cf021b5552
 langcode: en
-field_name: field_test_import_staging_2
+field_name: field_test_import_sync_2
 entity_type: entity_test
 bundle: test_bundle
 label: 'Test import field 2 on test bundle'
@@ -13,4 +13,4 @@ settings: { }
 field_type: text
 dependencies:
   config:
-    - field.storage.entity_test.field_test_import_staging_2
+    - field.storage.entity_test.field_test_import_sync_2
diff --git a/core/modules/field/tests/modules/field_test_config/staging/field.field.entity_test.test_bundle_2.field_test_import_staging_2.yml b/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle_2.field_test_import_sync_2.yml
similarity index 64%
rename from core/modules/field/tests/modules/field_test_config/staging/field.field.entity_test.test_bundle_2.field_test_import_staging_2.yml
rename to core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle_2.field_test_import_sync_2.yml
index de66085aa0b3..3afd2e255c0c 100644
--- a/core/modules/field/tests/modules/field_test_config/staging/field.field.entity_test.test_bundle_2.field_test_import_staging_2.yml
+++ b/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle_2.field_test_import_sync_2.yml
@@ -1,7 +1,7 @@
-id: entity_test.test_bundle_2.field_test_import_staging_2
+id: entity_test.test_bundle_2.field_test_import_sync_2
 uuid: 49d6dd19-5097-443d-8f00-fc79525bebce
 langcode: en
-field_name: field_test_import_staging_2
+field_name: field_test_import_sync_2
 entity_type: entity_test
 bundle: test_bundle_2
 label: 'Test import field 2 on test bundle 2'
@@ -13,4 +13,4 @@ settings: { }
 field_type: text
 dependencies:
   config:
-    - field.storage.entity_test.field_test_import_staging_2
+    - field.storage.entity_test.field_test_import_sync_2
diff --git a/core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging.yml b/core/modules/field/tests/modules/field_test_config/sync/field.storage.entity_test.field_test_import_sync.yml
similarity index 79%
rename from core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging.yml
rename to core/modules/field/tests/modules/field_test_config/sync/field.storage.entity_test.field_test_import_sync.yml
index 394c83b763ed..83c9aaec1bfd 100644
--- a/core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging.yml
+++ b/core/modules/field/tests/modules/field_test_config/sync/field.storage.entity_test.field_test_import_sync.yml
@@ -1,7 +1,7 @@
-id: entity_test.field_test_import_staging
+id: entity_test.field_test_import_sync
 uuid: 0bf654cc-f14a-4881-b94c-76959e47466b
 langcode: en
-field_name: field_test_import_staging
+field_name: field_test_import_sync
 entity_type: entity_test
 type: text
 settings:
diff --git a/core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging_2.yml b/core/modules/field/tests/modules/field_test_config/sync/field.storage.entity_test.field_test_import_sync_2.yml
similarity index 79%
rename from core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging_2.yml
rename to core/modules/field/tests/modules/field_test_config/sync/field.storage.entity_test.field_test_import_sync_2.yml
index d035ef8c3393..d692f78bcbca 100644
--- a/core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging_2.yml
+++ b/core/modules/field/tests/modules/field_test_config/sync/field.storage.entity_test.field_test_import_sync_2.yml
@@ -1,7 +1,7 @@
-id: entity_test.field_test_import_staging_2
+id: entity_test.field_test_import_sync_2
 uuid: 2165d9aa-9a0c-41a1-be02-2a49f3405c00
 langcode: en
-field_name: field_test_import_staging_2
+field_name: field_test_import_sync_2
 entity_type: entity_test
 type: text
 settings:
diff --git a/core/modules/image/src/Tests/ImageAdminStylesTest.php b/core/modules/image/src/Tests/ImageAdminStylesTest.php
index 194c016ce614..ed3854fcba90 100644
--- a/core/modules/image/src/Tests/ImageAdminStylesTest.php
+++ b/core/modules/image/src/Tests/ImageAdminStylesTest.php
@@ -443,11 +443,11 @@ function testConfigImport() {
     $this->drupalGet('node/' . $nid);
     $this->assertRaw($style->buildUrl($original_uri), format_string('Image displayed using style @style.', array('@style' => $style_name)));
 
-    // Copy config to staging, and delete the image style.
-    $staging = $this->container->get('config.storage.staging');
+    // Copy config to sync, and delete the image style.
+    $sync = $this->container->get('config.storage.sync');
     $active = $this->container->get('config.storage');
-    $this->copyConfig($active, $staging);
-    $staging->delete('image.style.' . $style_name);
+    $this->copyConfig($active, $sync);
+    $sync->delete('image.style.' . $style_name);
     $this->configImporter()->import();
 
     $this->assertFalse(ImageStyle::load($style_name), 'Style deleted after config import.');
diff --git a/core/modules/language/src/Tests/LanguageConfigOverrideImportTest.php b/core/modules/language/src/Tests/LanguageConfigOverrideImportTest.php
index 537584dd4cd8..c7506480936a 100644
--- a/core/modules/language/src/Tests/LanguageConfigOverrideImportTest.php
+++ b/core/modules/language/src/Tests/LanguageConfigOverrideImportTest.php
@@ -29,9 +29,9 @@ class LanguageConfigOverrideImportTest extends WebTestBase {
    */
   public function testConfigOverrideImport() {
     ConfigurableLanguage::createFromLangcode('fr')->save();
-    /* @var \Drupal\Core\Config\StorageInterface $staging */
-    $staging = \Drupal::service('config.storage.staging');
-    $this->copyConfig(\Drupal::service('config.storage'), $staging);
+    /* @var \Drupal\Core\Config\StorageInterface $sync */
+    $sync = \Drupal::service('config.storage.sync');
+    $this->copyConfig(\Drupal::service('config.storage'), $sync);
 
     // Uninstall the language module and its dependencies so we can test
     // enabling the language module and creating overrides at the same time
@@ -41,11 +41,11 @@ public function testConfigOverrideImport() {
     // ConfigFactory.
     $this->rebuildContainer();
 
-    /* @var \Drupal\Core\Config\StorageInterface $override_staging */
-    $override_staging = $staging->createCollection('language.fr');
-    // Create some overrides in staging.
-    $override_staging->write('system.site', array('name' => 'FR default site name'));
-    $override_staging->write('system.maintenance', array('message' => 'FR message: @site is currently under maintenance. We should be back shortly. Thank you for your patience'));
+    /* @var \Drupal\Core\Config\StorageInterface $override_sync */
+    $override_sync = $sync->createCollection('language.fr');
+    // Create some overrides in sync.
+    $override_sync->write('system.site', array('name' => 'FR default site name'));
+    $override_sync->write('system.maintenance', array('message' => 'FR message: @site is currently under maintenance. We should be back shortly. Thank you for your patience'));
 
     $this->configImporter()->import();
     $this->rebuildContainer();
@@ -71,14 +71,14 @@ public function testConfigOverrideImportEvents() {
 
     ConfigurableLanguage::createFromLangcode('fr')->save();
 
-    /* @var \Drupal\Core\Config\StorageInterface $staging */
-    $staging = \Drupal::service('config.storage.staging');
-    $this->copyConfig(\Drupal::service('config.storage'), $staging);
+    /* @var \Drupal\Core\Config\StorageInterface $sync */
+    $sync = \Drupal::service('config.storage.sync');
+    $this->copyConfig(\Drupal::service('config.storage'), $sync);
 
-    /* @var \Drupal\Core\Config\StorageInterface $override_staging */
-    $override_staging = $staging->createCollection('language.fr');
-    // Create some overrides in staging.
-    $override_staging->write('system.site', array('name' => 'FR default site name'));
+    /* @var \Drupal\Core\Config\StorageInterface $override_sync */
+    $override_sync = $sync->createCollection('language.fr');
+    // Create some overrides in sync.
+    $override_sync->write('system.site', array('name' => 'FR default site name'));
     \Drupal::state()->set('config_events_test.event', FALSE);
 
     $this->configImporter()->import();
diff --git a/core/modules/node/src/Tests/Config/NodeImportChangeTest.php b/core/modules/node/src/Tests/Config/NodeImportChangeTest.php
index 4e1fbc1db94d..33f07c27ea57 100644
--- a/core/modules/node/src/Tests/Config/NodeImportChangeTest.php
+++ b/core/modules/node/src/Tests/Config/NodeImportChangeTest.php
@@ -44,16 +44,16 @@ public function testImportChange() {
     // Simulate config data to import:
     // - a modified version (modified label) of the node type config.
     $active = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
-    $this->copyConfig($active, $staging);
+    $sync = $this->container->get('config.storage.sync');
+    $this->copyConfig($active, $sync);
 
     $node_type = $active->read($node_type_config_name);
     $new_label = 'Test update import field';
     $node_type['name'] = $new_label;
-    // Save as files in the staging directory.
-    $staging->write($node_type_config_name, $node_type);
+    // Save as files in the sync directory.
+    $sync->write($node_type_config_name, $node_type);
 
-    // Import the content of the staging directory.
+    // Import the content of the sync directory.
     $this->configImporter()->import();
 
     // Check that the updated config was correctly imported.
diff --git a/core/modules/node/src/Tests/Config/NodeImportCreateTest.php b/core/modules/node/src/Tests/Config/NodeImportCreateTest.php
index 97fe51f7252d..8b7c502653a1 100644
--- a/core/modules/node/src/Tests/Config/NodeImportCreateTest.php
+++ b/core/modules/node/src/Tests/Config/NodeImportCreateTest.php
@@ -61,19 +61,19 @@ public function testImportCreate() {
 
     // Simulate config data to import.
     $active = $this->container->get('config.storage');
-    $staging = $this->container->get('config.storage.staging');
-    $this->copyConfig($active, $staging);
+    $sync = $this->container->get('config.storage.sync');
+    $this->copyConfig($active, $sync);
     // Manually add new node type.
-    $src_dir = drupal_get_path('module', 'node_test_config') . '/staging';
-    $target_dir = $this->configDirectories[CONFIG_STAGING_DIRECTORY];
+    $src_dir = drupal_get_path('module', 'node_test_config') . '/sync';
+    $target_dir = $this->configDirectories[CONFIG_SYNC_DIRECTORY];
     $this->assertTrue(file_unmanaged_copy("$src_dir/$node_type_config_name.yml", "$target_dir/$node_type_config_name.yml"));
 
-    // Import the content of the staging directory.
+    // Import the content of the sync directory.
     $this->configImporter()->import();
 
     // Check that the content type was created.
     $node_type = NodeType::load($node_type_id);
-    $this->assertTrue($node_type, 'Import node type from staging was created.');
+    $this->assertTrue($node_type, 'Import node type from sync was created.');
     $this->assertFalse(FieldConfig::loadByName('node', $node_type_id, 'body'));
   }
 
diff --git a/core/modules/node/tests/modules/node_test_config/staging/node.type.import.yml b/core/modules/node/tests/modules/node_test_config/sync/node.type.import.yml
similarity index 100%
rename from core/modules/node/tests/modules/node_test_config/staging/node.type.import.yml
rename to core/modules/node/tests/modules/node_test_config/sync/node.type.import.yml
diff --git a/core/modules/options/src/Tests/OptionsFloatFieldImportTest.php b/core/modules/options/src/Tests/OptionsFloatFieldImportTest.php
index 5be5840bedf0..5926afbc402d 100644
--- a/core/modules/options/src/Tests/OptionsFloatFieldImportTest.php
+++ b/core/modules/options/src/Tests/OptionsFloatFieldImportTest.php
@@ -48,8 +48,8 @@ public function testImport() {
 
     $admin_path = 'admin/structure/types/manage/' . $type . '/fields/node.' . $type . '.' . $field_name . '/storage';
 
-    // Export active config to staging
-    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
+    // Export active config to sync.
+    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
 
     // Set the active to not use dots in the allowed values key names.
     $edit = array('settings[allowed_values]' => "0|Zero\n1|One");
diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php
index 394c76757835..f11b5670a8b4 100644
--- a/core/modules/simpletest/src/KernelTestBase.php
+++ b/core/modules/simpletest/src/KernelTestBase.php
@@ -116,20 +116,20 @@ protected function beforePrepareEnvironment() {
    * @see config_get_config_directory()
    *
    * @throws \RuntimeException
-   *   Thrown when CONFIG_STAGING_DIRECTORY cannot be created or made writable.
+   *   Thrown when CONFIG_SYNC_DIRECTORY cannot be created or made writable.
    */
   protected function prepareConfigDirectories() {
     $this->configDirectories = array();
     include_once DRUPAL_ROOT . '/core/includes/install.inc';
     // Assign the relative path to the global variable.
-    $path = $this->siteDirectory . '/config_' . CONFIG_STAGING_DIRECTORY;
-    $GLOBALS['config_directories'][CONFIG_STAGING_DIRECTORY] = $path;
+    $path = $this->siteDirectory . '/config_' . CONFIG_SYNC_DIRECTORY;
+    $GLOBALS['config_directories'][CONFIG_SYNC_DIRECTORY] = $path;
     // Ensure the directory can be created and is writeable.
-    if (!install_ensure_config_directory(CONFIG_STAGING_DIRECTORY)) {
-      throw new \RuntimeException("Failed to create '" . CONFIG_STAGING_DIRECTORY . "' config directory $path");
+    if (!install_ensure_config_directory(CONFIG_SYNC_DIRECTORY)) {
+      throw new \RuntimeException("Failed to create '" . CONFIG_SYNC_DIRECTORY . "' config directory $path");
     }
     // Provide the already resolved path for tests.
-    $this->configDirectories[CONFIG_STAGING_DIRECTORY] = $path;
+    $this->configDirectories[CONFIG_SYNC_DIRECTORY] = $path;
   }
 
   /**
diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php
index 7abfa2f19e26..22709580fb62 100644
--- a/core/modules/simpletest/src/TestBase.php
+++ b/core/modules/simpletest/src/TestBase.php
@@ -1518,7 +1518,7 @@ public function configImporter() {
     if (!$this->configImporter) {
       // Set up the ConfigImporter object for testing.
       $storage_comparer = new StorageComparer(
-        $this->container->get('config.storage.staging'),
+        $this->container->get('config.storage.sync'),
         $this->container->get('config.storage'),
         $this->container->get('config.manager')
       );
diff --git a/core/modules/system/src/Tests/Entity/ConfigEntityImportTest.php b/core/modules/system/src/Tests/Entity/ConfigEntityImportTest.php
index 19caf37bd784..f7fbe1ce76b6 100644
--- a/core/modules/system/src/Tests/Entity/ConfigEntityImportTest.php
+++ b/core/modules/system/src/Tests/Entity/ConfigEntityImportTest.php
@@ -31,7 +31,7 @@ class ConfigEntityImportTest extends WebTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
+    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
   }
 
   /**
@@ -58,7 +58,7 @@ protected function doActionUpdate() {
 
     $this->checkSinglePluginConfigSync($entity, 'configuration', 'message', '');
 
-    // Read the existing data, and prepare an altered version in staging.
+    // Read the existing data, and prepare an altered version in sync.
     $custom_data = $original_data = $this->container->get('config.storage')->read($name);
     $custom_data['configuration']['message'] = 'Granny Smith';
     $this->assertConfigUpdateImport($name, $original_data, $custom_data);
@@ -78,7 +78,7 @@ protected function doBlockUpdate() {
 
     $this->checkSinglePluginConfigSync($block, 'settings', 'label', 'Red Delicious');
 
-    // Read the existing data, and prepare an altered version in staging.
+    // Read the existing data, and prepare an altered version in sync.
     $custom_data = $original_data = $this->container->get('config.storage')->read($name);
     $custom_data['settings']['label'] = 'Granny Smith';
     $this->assertConfigUpdateImport($name, $original_data, $custom_data);
@@ -110,7 +110,7 @@ protected function doFilterFormatUpdate() {
     $this->assertIdentical($filters, $entity->get('filters'));
     $this->assertIdentical($filters, $plugin_collection->getConfiguration());
 
-    // Read the existing data, and prepare an altered version in staging.
+    // Read the existing data, and prepare an altered version in sync.
     $custom_data = $original_data = $this->container->get('config.storage')->read($name);
     $custom_data['filters']['filter_url']['settings']['filter_url_length'] = 100;
     $this->assertConfigUpdateImport($name, $original_data, $custom_data);
@@ -145,7 +145,7 @@ protected function doImageStyleUpdate() {
     $this->assertIdentical($effects, $entity->get('effects'));
     $this->assertIdentical($effects, $plugin_collection->getConfiguration());
 
-    // Read the existing data, and prepare an altered version in staging.
+    // Read the existing data, and prepare an altered version in sync.
     $custom_data = $original_data = $this->container->get('config.storage')->read($name);
     $effect_name = key($original_data['effects']);
 
@@ -167,7 +167,7 @@ protected function doSearchPageUpdate() {
 
     $this->checkSinglePluginConfigSync($entity, 'configuration', 'boost', 'bi');
 
-    // Read the existing data, and prepare an altered version in staging.
+    // Read the existing data, and prepare an altered version in sync.
     $custom_data = $original_data = $this->container->get('config.storage')->read($name);
     $custom_data['configuration']['boost'] = 'asdf';
     $this->assertConfigUpdateImport($name, $original_data, $custom_data);
@@ -218,7 +218,7 @@ protected function checkSinglePluginConfigSync(EntityWithPluginCollectionInterfa
    *   The new data to store in the config object.
    */
   public function assertConfigUpdateImport($name, $original_data, $custom_data) {
-    $this->container->get('config.storage.staging')->write($name, $custom_data);
+    $this->container->get('config.storage.sync')->write($name, $custom_data);
 
     // Verify the active configuration still returns the default values.
     $config = $this->config($name);
diff --git a/core/modules/system/src/Tests/Entity/ContentEntityNullStorageTest.php b/core/modules/system/src/Tests/Entity/ContentEntityNullStorageTest.php
index 69ad3b9f1ca0..376b02e60a33 100644
--- a/core/modules/system/src/Tests/Entity/ContentEntityNullStorageTest.php
+++ b/core/modules/system/src/Tests/Entity/ContentEntityNullStorageTest.php
@@ -51,11 +51,11 @@ public function testDeleteThroughImport() {
     $contact_form = ContactForm::create(['id' => 'test']);
     $contact_form->save();
 
-    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
+    $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
 
     // Set up the ConfigImporter object for testing.
     $storage_comparer = new StorageComparer(
-      $this->container->get('config.storage.staging'),
+      $this->container->get('config.storage.sync'),
       $this->container->get('config.storage'),
       $this->container->get('config.manager')
     );
@@ -71,9 +71,9 @@ public function testDeleteThroughImport() {
       $this->container->get('string_translation')
     );
 
-    // Delete the contact message in staging.
-    $staging = $this->container->get('config.storage.staging');
-    $staging->delete($contact_form->getConfigDependencyName());
+    // Delete the contact message in sync.
+    $sync = $this->container->get('config.storage.sync');
+    $sync->delete($contact_form->getConfigDependencyName());
 
     // Import.
     $config_importer->reset()->import();
diff --git a/core/modules/system/src/Tests/Installer/InstallerExistingSettingsNoProfileTest.php b/core/modules/system/src/Tests/Installer/InstallerExistingSettingsNoProfileTest.php
index 1b915d57de8d..f821d9dda7ad 100644
--- a/core/modules/system/src/Tests/Installer/InstallerExistingSettingsNoProfileTest.php
+++ b/core/modules/system/src/Tests/Installer/InstallerExistingSettingsNoProfileTest.php
@@ -46,12 +46,12 @@ protected function setUp() {
 
     // Pre-configure config directories.
     $this->settings['config_directories'] = array(
-      CONFIG_STAGING_DIRECTORY => (object) array(
-        'value' => DrupalKernel::findSitePath(Request::createFromGlobals()) . '/files/config_staging',
+      CONFIG_SYNC_DIRECTORY => (object) array(
+        'value' => DrupalKernel::findSitePath(Request::createFromGlobals()) . '/files/config_sync',
         'required' => TRUE,
       ),
     );
-    mkdir($this->settings['config_directories'][CONFIG_STAGING_DIRECTORY]->value, 0777, TRUE);
+    mkdir($this->settings['config_directories'][CONFIG_SYNC_DIRECTORY]->value, 0777, TRUE);
 
     parent::setUp();
   }
diff --git a/core/modules/system/src/Tests/Installer/InstallerExistingSettingsTest.php b/core/modules/system/src/Tests/Installer/InstallerExistingSettingsTest.php
index 0d906f8fea1b..bd4f48cfb597 100644
--- a/core/modules/system/src/Tests/Installer/InstallerExistingSettingsTest.php
+++ b/core/modules/system/src/Tests/Installer/InstallerExistingSettingsTest.php
@@ -55,12 +55,12 @@ protected function setUp() {
     $site_path = DrupalKernel::findSitePath(Request::createFromGlobals());
     // Pre-configure config directories.
     $this->settings['config_directories'] = array(
-      CONFIG_STAGING_DIRECTORY => (object) array(
-        'value' => $site_path . '/files/config_staging',
+      CONFIG_SYNC_DIRECTORY => (object) array(
+        'value' => $site_path . '/files/config_sync',
         'required' => TRUE,
       ),
     );
-    mkdir($this->settings['config_directories'][CONFIG_STAGING_DIRECTORY]->value, 0777, TRUE);
+    mkdir($this->settings['config_directories'][CONFIG_SYNC_DIRECTORY]->value, 0777, TRUE);
 
     parent::setUp();
   }
diff --git a/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php b/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
index 5a3f3591e72a..b98dea26122b 100644
--- a/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
+++ b/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
@@ -138,7 +138,7 @@ public function testGetDependencies() {
       $dependencies = $view->getDependencies();
       $this->assertEqual($expected[$view_id], $dependencies);
       $config = $this->config('views.view.' . $view_id);
-      \Drupal::service('config.storage.staging')->write($view_id, $config->get());
+      \Drupal::service('config.storage.sync')->write($view_id, $config->get());
     }
 
     // Ensure that dependencies are calculated on the display level.
diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php
index 6b95f4d1d802..fd7b8643634d 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBase.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -260,7 +260,7 @@ protected function bootEnvironment() {
     $this->siteDirectory = vfsStream::url('root/sites/simpletest/' . $suffix);
 
     mkdir($this->siteDirectory . '/files', 0775);
-    mkdir($this->siteDirectory . '/files/config/' . CONFIG_STAGING_DIRECTORY, 0775, TRUE);
+    mkdir($this->siteDirectory . '/files/config/' . CONFIG_SYNC_DIRECTORY, 0775, TRUE);
 
     // Ensure that all code that relies on drupal_valid_test_ua() can still be
     // safely executed. This primarily affects the (test) site directory
@@ -278,7 +278,7 @@ protected function bootEnvironment() {
     new Settings($settings);
 
     $GLOBALS['config_directories'] = array(
-      CONFIG_STAGING_DIRECTORY => $this->siteDirectory . '/files/config/staging',
+      CONFIG_SYNC_DIRECTORY => $this->siteDirectory . '/files/config/sync',
     );
 
     foreach (Database::getAllConnectionInfo() as $key => $targets) {
@@ -943,7 +943,7 @@ protected function configImporter() {
     if (!$this->configImporter) {
       // Set up the ConfigImporter object for testing.
       $storage_comparer = new StorageComparer(
-        $this->container->get('config.storage.staging'),
+        $this->container->get('config.storage.sync'),
         $this->container->get('config.storage'),
         $this->container->get('config.manager')
       );
@@ -1088,7 +1088,7 @@ public function __get($name) {
     if ($name === 'configDirectories') {
       trigger_error(sprintf("KernelTestBase::\$%s no longer exists. Use config_get_config_directory() directly instead.", $name), E_USER_DEPRECATED);
       return array(
-        CONFIG_STAGING_DIRECTORY => config_get_config_directory(CONFIG_STAGING_DIRECTORY),
+        CONFIG_SYNC_DIRECTORY => config_get_config_directory(CONFIG_SYNC_DIRECTORY),
       );
     }
 
diff --git a/core/tests/Drupal/KernelTests/KernelTestBaseTest.php b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php
index 2c02b7c759bb..188d1116e575 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBaseTest.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php
@@ -39,7 +39,7 @@ public function testBootEnvironment() {
             substr($this->databasePrefix, 10) => array(
               'files' => array(
                 'config' => array(
-                  'staging' => array(),
+                  'sync' => array(),
                 ),
               ),
             ),
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index 7d3a3ae44292..6a45d254067e 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -223,13 +223,13 @@
  * Location of the site configuration files.
  *
  * The $config_directories array specifies the location of file system
- * directories used for configuration data. On install, "active" and "staging"
- * directories are created for configuration. The staging directory is used for
+ * directories used for configuration data. On install, "active" and "sync"
+ * directories are created for configuration. The sync directory is used for
  * configuration imports; the active directory is not used by default, since the
  * default storage for active configuration is the database rather than the file
  * system (this can be changed; see "Active configuration settings" below).
  *
- * The default location for the active and staging directories is inside a
+ * The default location for the active and sync directories is inside a
  * randomly-named directory in the public files path; this setting allows you to
  * override these locations. If you use files for the active configuration, you
  * can enhance security by putting the active configuration outside your
@@ -238,7 +238,7 @@
  * Example:
  * @code
  *   $config_directories = array(
- *     CONFIG_STAGING_DIRECTORY => '/another/directory/outside/webroot',
+ *     CONFIG_SYNC_DIRECTORY => '/another/directory/outside/webroot',
  *   );
  * @endcode
  */
-- 
GitLab