Issues migrating site config at various points in project lifecycle Issues migrating site config at various points in project lifecycle 

Hi

My team and I have begun a new project for our company using the very latest version of Drupal 8 (version 8.5.6)

We wanted to use config migration in order to carry config changes from one developer across to another seamlessly and across to staging and production environments.

We are in the middle of testing the migration workflow and have run into a problem. 

I started off the project by doing a standard Drupal 8 installation. I then did a migrations export (drupal ce), committed this to the repository.

My colleague proceeded to install Drupal also, also a standard install, composer install, drush cr etc., and then pulled the latest changes and ran drupal ci and ran into an error, namely:

[ERROR] An error occurred while trying to write the config file: "Entities exist of type &lt;em                           
     class="placeholder"&gt;Shortcut link&lt;/em&gt; and &lt;em class="placeholder"&gt;Shortcut set&lt;/em&gt; &lt;em                       
     class="placeholder"&gt;Default&lt;/em&gt;. These entities need to be deleted before importing."


Prior to this we had an additional issue where Drupal complained about mismatched UUID’s. We got around this by updating his UUID as follows:

Error received:

[ERROR] An error occurred while trying to write the config file: "Site UUID in source storage does not match the target storage.


Fixed with:

drush config-set "system.site" uuid "42e3c541-5ebc-4ec9-a8f0-e8c6ad1ccfb7


The above UUID was gained from my installation.

So now we are left with the first error explained above.

We tried deleting the shortcuts manually, as suggested in several places on the internet, but this caused his system to completely break.

I also thought possibly that instead of him doing a clean, standard install at the start of the work that he should have used a snapshot of my initial installation, and when we move the app to staging and/or development it will follow suit that we use backups for the initial setup to ensure the DB is in sync with regard to UUIDs, but I am not convinced this is the correct way to do it.

So, we are a little lost on exactly what is the recommended workflow for migrations, with the view that we will be using the workflow going into production also, e.g. after launch we will want to use config migration export/imports to apply changes made locally.
My colleague proceeded to install Drupal also, also a standard install, composer install, drush cr etc., and then pulled the latest changes and ran drupal ci and ran into an error, namely:


Don't do that. Config import/export is meant to be used for the same site. That's exactly why the site UUID check exists, that's to tell you that what you are trying to do doesn't work.

Either you need to sync the database or you need to use something like https://www.drupal.org/project/config_installer to install based on an existing set of configuration.

Usually the process is that content and configuration flow in opposite direction. You have your production site where new content is created, from time to time you want to sync the full DB down to your staging/development and then you have configuration changes that you are creating locally and then deploying to dev/staging/production.

See also presentations like https://events.drupal.org/vienna2017/sessions/advanced-configuration-management-config-split-et-al for example.