-2

Can it be used to get configuration from one site to another site which is not a clone.

eg: SiteX is installed using

composer create-project drupal-composer/drupal-project:8.x-dev SiteX

and also another site SiteY using

composer create-project drupal-composer/drupal-project:8.x-dev SiteY

I did some changes to SiteX( New content type with few fields). I did drush cex to get the configuration and imported in SiteY config/sync folder and did drush cim. I did not see the new content type in SiteY. Based on some other articles, i tried

drush cget system.site uuid in SiteX

drush cset system.site uuid  # in SiteY

drush cim # in SiteY

Still no luck. I don't see the new content type.

Does this configuration synchronization, only work in cloned sites ??.

My whole requirement is to export the configuration from one environment is another with out moving content.

Note: We have GIT, local, Test and Prod are the three environments. Currently we are still in local stage. So a full config export is possible for higher environments. DB dump( export and import ) is not possible as content also gets migrated. Please correct me if I am wrong.

  • 3
    Why does this question remind me about this one??? From "Harry", 2 days ago, same profile picture ... – Pierre.Vriens Jan 14 at 16:49
  • 2
    @Pierre.Vriens why does this question remind me of this other one also from "Harry" 4 days ago. – No Sssweat Jan 14 at 17:01
  • 3
    I feel like it’s been answered many times over the years too. – Kevin Jan 14 at 17:19
  • 2
    @NoSssweat more of the same ... this time for D7 ... Wait!!! Does it really matter what version tag these questions have? – Pierre.Vriens Jan 14 at 17:23
  • 2
    Because after few hours, no body looks at the question let alone answering it. questions that do not get answers or receive accepted answers after certain periods of time are automatically bumped to the homepage. There is no reason to keep posting the same question over and over. – Kevin Jan 14 at 17:55
0

Configuration can be used to sync between how many sites you want. All you have to ensure is that they have the same site UUID to be set and all the same dependencies (modules, libraries) in the same version to be existent.

You also could install a site from the copied config from another site.

drush si minimal --existing-config

What you are describing should be a pretty normal deployment circle. Code and config always goes upstream (from local to dev to stage to prod) whereas the database and the content in it always goes downstream (database dump from prod to be imported on stage, dev and local).

During releases and merges you then ensure that a set of certain commands be run to keep everything consistent.

git pull
composer install
drush updb
drush cim
drush cron
drush cr

@see Order of drush commands for automated deployment?

  • Flusing cache did not help. /add/articlex shows page not found. Another thing to note is I had migrate, migtate_tools, migrate_example modules installed in SiteX for csv content import. It has examples wine, beer, product etc.. examples.. I see those as content types in SiteY. .. Steps Followed 1) drush cex # for SiteX 2) composer create # SiteY 3) Updated compose.json in SiteY to install modules and ran composer update. This installed all the modules 4) copied all the yaml files from SiteX config to SiteY config 5) drush cset system.site uuid # in SiteY 6) drush cim – Toshiro Jan 14 at 18:35
  • I tried with fresh installs and it worked with the exception, that I have not installed any modules in SiteX and SiteY. I am able to see the new content types created for SiteX in SiteY. Thanks for the help. I will try with modules next. – Toshiro Jan 16 at 21:49

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.