2

I have 3 different environments such as Dev, Test and Stage. I'm currently facing an issue when trying to propagate my changes from Dev into Test and Stage envs. In order to propagate the changes i use the Features module. Within features i export all my Content Types. Some of them (e.g. Basic Page) are already exist into Test and Stage environments. When i'm trying to install the feature export from Dev into the other environments, the Basic Page content type of Test and Stage actually seems to be overridden. This means that the predefined fields that already has are not erased by the feature but it just adds the new created fields. How can i solve this issue. The desired functionality is to have the same fields after importing the future to all environments.

0

If I'm not mistaken, Features doesn't delete fields it only synchronizes the configuration and creates new fields if they are not present. So, deleting obsolete fields is one of the processes you have to do by hand (or write an update function in a custom module).

Features is a handy tool, but certainly has some limits (for instance when you want to synchronize blocks).

  • or i can manually delete the content type on my Test or Stage envs and then re-import the feature.. Thanks for you help! – Labrosb Apr 14 '16 at 12:22
  • Make a backup of your database and try it on your test server. See what happens ;) However, don't forget that you will lose all stored information/data/nodes of the particular content types when you delete them.... – Watergate Apr 14 '16 at 12:57
0

I believe 1 approach using features do manage your setup like your doing is to use hook_update_n() to delete fields you no longer want in versions of your module. So some tidying up code is in an update function assure only the fields you want in your content type exist at a certain version.

For Drupal 8 Dries has a recent blog post describing the Deploy, Replication and other modules to help move content around: http://buytaert.net/improving-drupal-content-workflow

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.