I have this error when I try to import the config of an another site:

The staged configuration cannot be imported, because it originates from a different site than this site. You can only synchronize configuration between cloned instances of this site.

I have 10 customers, and I need to sync my site configuration with 10 different websites.
The site UUID is a problem for sharing a configuration with a different website. Is there a solution?

You can get the UUID with:

drush config-get "system.site" uuid

And you can change it with

drush config-set "system.site" uuid "fjfj34-e3bb-2ab8-4d21-9100-b5etgetgd99d5"

With that you gotta have the same sites.

The Configuration Management only allow sync configuration between same site or project to avoid issues importing configuration from site a.com to b.com, to accomplish this validation Drupal 8 generate a UUID for each site.

You cat get your current site UUID executing the following command:

drush cget system.site

The command above we will have a similar output to next listing:

uuid: 236fa77c-d83e-42de-8a03-03c574c00160
name: Drupal 8
mail: user@example.com
slogan: ''
page:
  403: ''
  404: ''
  front: node
admin_compact_mode: false
weight_select_max: 100
langcode: en

The config import has a different UUID, you can confirm the UUID with the following command

cat sites/default/config/staging/system.site.yml

For that reason you need to change the value of Site UUID using the following Drush command:

drush cedit system.site

The command above enable you to use your favorite text editor to set the same UUID present in staging config files.

cat sites/default/config/staging/system.site.yml

After change the UUID and change the permissions, if you visit again the page example.com/admin/config/development/configuration you will see all changes, deletions, renames, and additions.

source: http://enzolutions.com/articles/2014/08/27/understanding-configuration-management-in-drupal-8/

  • 7
    Correct, but keep in mind that changing the site UUID without changing any others means that drupal will treat every field/node type/view/... that has a different UUID as a different thing and will first delete the old and then re-create it again, which will essentially delete all your content. – Berdir Mar 5 '15 at 15:47
  • Ok thank you, but it's not user-friendly for a user without a dedicated server and linux knowledge, a solution exist for basic/beginner users (without ssh and command lines, only a ftp server) please ? Drush need command lines and it's not user-friendly for my customers. – Axel Briche Mar 7 '15 at 12:56
  • What's happen exactly if I change the site UUID of an existing Drupal website (fresh install) to match the exported configuration (with drush config-set system.site uuid "abcdef-...") ? – GiDo Sep 15 '15 at 16:19
  • One-line command to copy update site UUID. drush -y cset system.site uuid $(cat /path/to/config/system.site.yml | awk '/uuid/ { print $2 }') – ya.teck Aug 29 '17 at 10:14

Using Drupal Console

You can achieve the same with Drupal Console by overriding the system.siteuuid key.

$ drupal config:override

Then enter the configuration name system.site, the configuration key uuid and the appropriate value when prompted.

Enter configuration name [advagg.settings]:
> system.site

Enter the configuration key [uuid]:
> uuid

Enter the configuration value:
> 656165f1-1017-45a1-9bd8-f70e31cf29ab

Configuration name system.site
------------------- -------------------------------------- -------------------------------------- 
Configuration key   Original Value                         Override Value                        
------------------- -------------------------------------- -------------------------------------- 
uuid                7622bb19-5f3f-452d-82a3-c0a88241e789   656165f1-1017-45a1-9bd8-f70e31cf29ab  
------------------- -------------------------------------- -------------------------------------- 

You can get the site UUID without access to the site or database.

If you don't have access to the original site/database, you can still sync from provided config files. The config will contain your site's UUID, so you need to set that first.

  1. Find your config/sync directory: If it's moved, you can find where it was set in settings.php. Look for: $config_directories['sync'], which will list the path.

  2. Go to that config path, and look for the file: system.site.yml In that file, look for uuid: 86b376c5-385e-4d13-bf00-e5e5443540e3 (you will have a different value, obviously). Copy that value.

  3. In drush, set your site to the same site uuid that we just discovered: drush cset system.site uuid 86b376c5-385e-4d13-bf00-e5e5443540e3

  4. Sync the config using drush drush cim -y

  5. If you get errors, read them. I had:

    • a missing module (which I had to download and enable)
    • content from the shortcuts module, which I had to delete first, at:
    • admin > config > User Interfact > Shortcuts

Once I did that, I reran the cim, and everything worked like a charm!

I had installed a local D8 instance before trying to restore from the provided config.

You can change the UUID for the destination site using drush cset and drush cget.

First get the source UUID:

$ cd ~/Sites/sourcesite <-- your drupal site root
$ drush cget system.site uuid
This will return something like:
'system.site:uuid': 86b376c5-385e-4d13-bf00-e5e5443540e3 

Replace the destination UUID

cd ~/Sites/destinationsite <-- your drupal site root
$ drush cset system.site uuid 86b376c5-385e-4d13-bf00-e5e5443540e3 

Now you can:

  1. Navigate to the destination site in your browser at admin/config/development/configuration/full/import
  2. select the configuration archive and select upload
  3. You will see a list of all the configuration items
  4. Scroll down to the bottom and click the import all button

This is something we hoped migration will provide but it's simply not coded yet.

  • Hello, have you any new informations about that please ? Drupal 8 is entered in RC now :) – Axel Briche Oct 10 '15 at 17:43
  • D8-D8 migrations are not written yet. – user49 Oct 10 '15 at 19:13

If you follow the instructions in Gucho Ca's answer, and still have the problem, be sure to check that you have write permissions in your sync config directory. It will give you this same error message, even if your uuids are the same, but your sytem doesn't have write permissions.

A good way to check is to click on the Import Tab of the Synchronize section. If you don't have the correct file permissions it will tell you there.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.