Skip to main content

After cloning a site, next you will want to import the config file.  Which you can do so by running the command:

drush cim -y

Hopefully it worked for you.  As it didn't work out so well for me as the response was:


 [error]  Drupal\Core\Config\ConfigImporterException: There were errors validating the config s                    ynchronization.
Site UUID in source storage does not match the target storage.
Entities exist of type <em class="placeholder">Shortcut link</em> and <em class="placeholder">S                    hortcut set</em> <em class="placeholder">Default</em>. These entities need to be deleted before                     importing. in Drupal\Core\Config\ConfigImporter->validate() (line 759 of /var/www/vhosts/mdba.                    gov.au/web/core/lib/Drupal/Core/Config/ConfigImporter.php).

In ConfigImportCommands.php line 324:

  The import failed due to the following reasons:
  Site UUID in source storage does not match the target storage.
  Entities exist of type <em class="placeholder">Shortcut link</em> and <em class="placehold
  er">Shortcut set</em> <em class="placeholder">Default</em>. These entities need to be dele
  ted before importing.

In case you had the same response as me.  Let's work through how to resolve this issue.

The error noted above is twofold.  First, the UUID doesn't match.  And second conflict with the Shortcut Link.  Let first focus on the UUID.

 

Get the different system.site uuid's

You can get the current UUID with

drush config-get "system.site" uuid

Or 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: 498d7c1-a41f-38da-bc12-92b4a8cb81aa
name: Drupal 9
mail: {your email}
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 ../config/sync/system.site.yml

 

Change or set the system.site uuid

Subsequently, you'll need to change the value of Site UUID using one of the following Drush commands:

drush cedit system.site

This command enables you to use your preferred IDE to set the same UUID present in config files.

cat config/snyc/system.site.yml

Whereas you can change / set the system site uuid:

drush config-set "system.site" uuid [uuid]

Replace the [UUID] with the UUDI from the config files.

 

Shortcut error

If you have the short error message, such as as noted earlier or

The import failed due to the following reasons: Entities exist of type <em class="placeholder">Shortcut link</em> and <em c lass="placeholder">Shortcut set</em> <em class="placeholder">Default</em>. These entities need to be deleted before importing.

The run the following command

drush -y entity:delete shortcut_set

THis command will delete the Shortcut set.  Once executed, you will be able to re-attempt the config import command

drush -y cim

 

 

Related articles