6

This is what I'm trying to do:

I have a website A where I make configuration changes and add other stuff. Now I create a website B. I would like to add the configuration changes from website A to this website.

I know the UUID of both websites have to be the same (like staging & production environment). In "How can I import the configuration on a different site?" they explain how to do this with drush cget system.site.

The problem is when I run drush cget system.site in my website A I get the following drush error:

Command config-get needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command. [error] The drush command 'cget system.site' could not be executed. [error] Drush was not able to start (bootstrap) the Drupal database. [error] Hint: This may occur when Drush is trying to: * bootstrap a site that has not been installed or does not have a configured database. In this case you can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command line. See drush topic docs-aliases for details. * connect the database through a socket. The socket file may be wrong or the php-cli may have no access to it in a jailed shell. See http://drupal.org/node/1428638 for details.

Drush was attempting to connect to:
 Drupal version         :  8.0.0-rc1
 Site URI               :  http://default
 Database driver        :  mysql
 Database hostname      :  localhost
 Database port          :  3306
 Database username      :  root
 Database name          :  s_1
 PHP executable         :  /Applications/MAMP/bin/php/php5.5.10/bin//php
 PHP configuration      :  /Applications/MAMP/bin/php/php5.5.10/conf/php.ini
 PHP OS                 :  Darwin
 Drush script           :  /Users/myname/.composer/vendor/drush/drush/drush.php
 Drush version          :  8.0-dev
 Drush temp directory   :  /tmp
 Drush configuration    :
 Drush alias files      :
 Drupal root            :  /Applications/MAMP/htdocs/s1
 Site path              :  sites/default
 Sync config path       :  sites/default/files/config_bZM1aJhLcWGpFZJEzfEw_pKF4g71jOdkSRti30k540BAwE9GQ4U6p469a9VxyJS4j4JVfC58qg/sync

I've installed the latest version of drush .. . I'm working with the release candidate of Drupal 8. Is there another way to get my UUID? Or do you have a tutorial or a video/blogpost of somebody who already did this?

UPDATE:

Ok, I was able to retrieve the UUID from website A and changed the UUID in website B so they have the equal UUID.

After that I changed the system site slogan of website A.

Then I did an export of the configuration in website A. But when I tried to import it in website B I got 137 new files to sync .. . The UUID is different in all files like this:

enter image description here

When I tried to synchronize I got the following error: enter image description here

  • Did you try executing other commands, such as drush status, and see if you get the same error? – kiamlaluno Oct 13 '15 at 9:11
  • drush status works, drush cache-rebuild works, ... – nielsv Oct 13 '15 at 9:25
8
+150

There was a discussion in the Drush issue queue on allowing config-import to force the adoption of the UUIDs in the imported configuration to be inserted into the database. The problem with allowing this is that this operation is equivalent to deleting all of your configuration (e.g. all of your content types) and then re-creating them, which has the side-effect of deleting all of the data associated with that configuration (e.g. all of the pages in your site). It was thought that erasing a site entirely was too surprising of a side-effect for a config-import operation, even with a --force flag, so this use case will not be supported.

The current thinking is that the right time to force the UUIDs of a site to change would be at site-install time. At the moment, the Drush site-install command does not support this directly; however, there is a configuration import installation profile that Alex Pott wrote that will perform this function. It should be possible to use this from Drush site-install.

In general, though, if your use-case is moving configuration from one site to a different site, you should use features, not the configuration system.

  • For dev-only environments, using $ drush devel-generate-uuid is an ugly but workable solution, too. It basically brute forces CMI's intended protection mechanisms. – anavarre Oct 16 '15 at 8:27
1

I have a website A where I make configuration changes and add other stuff. Now I create a website B. I would like to add the configuration changes from website A to this website.

That is not the use-case for Drupal configuration management. Site B should be a database clone of site A in order to sync configuration.

0

Have you tried the module Features who is able to move a lot of different settings between two sites?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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