Prepping the Site to be Installed on Production with the Configuration Installer Install Profile

One thing about Configuration Management is that it requires every site to share the same UUID. Otherwise you'll get an error, and not be able to sync configuration between your sites.

One way to manage this is to import the database from one "source" site into each "destination" site. Another (frowned upon and super hacky, not to mention fragile) way is to manually update the UUID in the system config file. The easiest and cleanest (in my opinion) however, is to use the Configuration Installer install profile. Basically, it let's you install a new site from an existing config export, like the one we just committed to Git.

Note: There's work in progress to get this functionality baked into core for Drupal 8.3.x. So, hopefully, in the near future, you won't have to install anything extra to do this, but for now, we do.

One downside of the official Drupal composer endpoint is that it doesn't yet support install profiles, so we'll have to download it with Drush and actually commit the code to our repository.

Note: You could alternatively just download it straight to the new installation location and keep it out of your repository entirely, but that's one extra step that has to be done each time the site is installed. ie: staging, production, each new team member that needs to spin up the site locally.) So, for the sake of this series we'll just add it to our repo.

drush dl config_installer
git add .
git commit -m "Installed the config_installer profile."
git push

Alright! Now we're all set to pull our repo onto our production server, and install the site from the configuration we just exported!