How to get and set site uuid drupal 8/9?
When you try to import configuration using "drush cim", you will get the message like this "[error] Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization.
Site UUID in source storage does not match the target storage."
The Configuration files only allow sync between same site to avoid issues importing configuration from one site to another.
We can import configuration from other websites into yours with Fresh drupal installation. Each Drupal installation uuid is unique.
Install the fresh Drupal version. then follow the below steps.
To Get the "uuid" value using drush:
drush config-get "system.site" uuid
open the system.site.yml file from /config/sync folder, then copy uuid and set it using the below drush command.
To set the "uuid" value using drush:
drush config-set system.site uuid 07fd574c-11cc-4b1b-b37c-83ac2baa18f8 -y
drush cset system.site uuid 907fd574c-11cc-4b1b-b37c-83ac2baa18f8 -y