Answers.Body: <p>This approach assumes that the individual websites won't diverge from the original blueprint by, for example, modifying sections and fields to suit their specific requirements.</p>
  
  <p>That seems pretty unlikely.</p>
  
  <p>I'd be inclined to stick with the idea of creating a "blueprint" site, to get new websites up-and-running quickly, but ditch the idea of updating previously-created sites whenever the blueprint is updated.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-20T12:05:03.833Z
Answers.Text: Individual websites shouldn't diverge from the blueprint. The 'standard functionality' should be very flexible.
Answers.UserDisplayName: Wieger Jelsma
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-20T12:11:45.170Z
Answers.Text: If you stick to the principle of "open for extension, closed for modification" (i.e. You can add _new_ fields and sections, but you can't modify _existing_ fields and sections), then you could—in theory—write scripted migrations to create the new elements. I still suspect it's way more trouble than it's worth, though.
Answers.UserDisplayName: Stephen Lewis
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-20T16:14:12.770Z
Answers.Text: It's challenging, I know. But talking about 100+ sites it's a lot of work to manually update them on a regular basis. Even for 25 it's very time consuming. Would you manage those scripted migrations inside a plugin or external through API (which Craft doesn't have yet btw).
Answers.UserDisplayName: Wieger Jelsma
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-20T16:40:21.703Z
Answers.Text: A plugin can define its own routes, meaning you can implement your own API. It depends how hands-off you want this to be. If you're going to be logging-in to each site, then you're essentially talking about building something very similar to Craft's auto-update feature. If you want to trigger the updates remotely, then you'll also need to consider endpoints and authentication.
Answers.UserDisplayName: Stephen Lewis
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-21T08:51:11.473Z
Answers.Text: I think log in manually is the best option. In that case you watch the process and catch some errors if their are any. Yes, something similar to Craft auto-update feature I guess. Thanks!
Answers.UserDisplayName: Wieger Jelsma
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-19T16:03:29.370Z
Answers.LastActivityDate: 2017-03-19T16:03:29.370Z
Answers.UserDisplayName: Stephen Lewis
Answers.Body: <p><strong>Patches</strong></p>
  
  <p>Create a patch and distribute it among your customers. It can be as simple as a diff. 
  If a core file is overwritten for some reason, the patch might fail.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-20T12:12:29.753Z
Answers.Text: How would you create that patch? Inside a plugin? Lets say 'AMP' for example. I would like to update all my websites and insert that functionality (some routes, templates and maybe a tab in the edit section in CP). I was thinking of a list of tasks which should run for each website. Is that doable inside a plugin? Or more like an external script which calls the API?
Answers.UserDisplayName: Wieger Jelsma
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-20T12:13:57.460Z
Answers.Text: I'd create a .sh file with a diff inside to patch the files you need and ask the site owner to apply it. Once the new code is In place you are all set.
Answers.UserDisplayName: mbalparda
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-20T16:11:37.453Z
Answers.Text: But it's not only concerning files. Also some DB changes should be made. Craft doesn't have an API (yet).
Answers.UserDisplayName: Wieger Jelsma
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-20T17:41:56.473Z
Answers.Text: You can modify the DB from the PHP code, I think I'm missing something obvious.
Answers.UserDisplayName: mbalparda
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-21T08:53:09.637Z
Answers.Text: This could work. You're talking about an external script which transfers new files to the system. And the newly added files take care of handling the DB. I guess a plugin should handle those DB changes. Let me think about that! Thanks.
Answers.UserDisplayName: Wieger Jelsma
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-19T23:54:48.270Z
Answers.LastActivityDate: 2017-03-19T23:54:48.270Z
Answers.UserDisplayName: mbalparda
Body: <p>I'm currently developing a blueprint for all my Craft websites. It contains a set of sections, fields, plugins etc. All configured the way I need for my websites. The websites itself are basically a fork of this blueprint and only has to have a custom template and content and we're good to go.</p>
  
  <p>The number of features in my blueprint will be growing as time passes along. What would be the best approach of updating all Craft installs so that each website (build upon previous blueprint versions) can benefit from the newly developed features.</p>
  
  <p>I could just backup the DB and code from the blueprint and import them into the website, but then I will be losing all content. </p>
  
  <p>Any idea? 
  Thanks in advance!</p>
  
Tags: <updating>
Title: What is the best approach of updating existing Craft installs with new features?
ThreadText: # What is the best approach of updating existing Craft installs with new features?
  
  (Asked by: username_0 on 2017-03-19)
  
  I'm currently developing a blueprint for all my Craft websites. It contains a set of sections, fields, plugins etc. All configured the way I need for my websites. The websites itself are basically a fork of this blueprint and only has to have a custom template and content and we're good to go.
  
  The number of features in my blueprint will be growing as time passes along. What would be the best approach of updating all Craft installs so that each website (build upon previous blueprint versions) can benefit from the newly developed features.
  
  I could just backup the DB and code from the blueprint and import them into the website, but then I will be losing all content.
  
  Any idea?
  Thanks in advance!
  
  **Tags:** updating
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-03-19. Score: 5
  
  This approach assumes that the individual websites won't diverge from the original blueprint by, for example, modifying sections and fields to suit their specific requirements.
  
  That seems pretty unlikely.
  
  I'd be inclined to stick with the idea of creating a "blueprint" site, to get new websites up-and-running quickly, but ditch the idea of updating previously-created sites whenever the blueprint is updated.
  
  > **Comments:**
  > **username_0**: Individual websites shouldn't diverge from the blueprint. The 'standard functionality' should be very flexible.  
  > **username_1**: If you stick to the principle of "open for extension, closed for modification" (i.e. You can add _new_ fields and sections, but you can't modify _existing_ fields and sections), then you could—in theory—write scripted migrations to create the new elements. I still suspect it's way more trouble than it's worth, though.  
  > **username_0**: It's challenging, I know. But talking about 100+ sites it's a lot of work to manually update them on a regular basis. Even for 25 it's very time consuming. Would you manage those scripted migrations inside a plugin or external through API (which Craft doesn't have yet btw).  
  > **username_1**: A plugin can define its own routes, meaning you can implement your own API. It depends how hands-off you want this to be. If you're going to be logging-in to each site, then you're essentially talking about building something very similar to Craft's auto-update feature. If you want to trigger the updates remotely, then you'll also need to consider endpoints and authentication.  
  > **username_0**: I think log in manually is the best option. In that case you watch the process and catch some errors if their are any. Yes, something similar to Craft auto-update feature I guess. Thanks!  
  
  ---
  
  ### Answer by username_2 on 2017-03-19. Score: 0
  
  **Patches**
  
  Create a patch and distribute it among your customers. It can be as simple as a diff.
  If a core file is overwritten for some reason, the patch might fail.
  
  > **Comments:**
  > **username_0**: How would you create that patch? Inside a plugin? Lets say 'AMP' for example. I would like to update all my websites and insert that functionality (some routes, templates and maybe a tab in the edit section in CP). I was thinking of a list of tasks which should run for each website. Is that doable inside a plugin? Or more like an external script which calls the API?  
  > **username_2**: I'd create a .sh file with a diff inside to patch the files you need and ask the site owner to apply it. Once the new code is In place you are all set.  
  > **username_0**: But it's not only concerning files. Also some DB changes should be made. Craft doesn't have an API (yet).  
  > **username_2**: You can modify the DB from the PHP code, I think I'm missing something obvious.  
  > **username_0**: This could work. You're talking about an external script which transfers new files to the system. And the newly added files take care of handling the DB. I guess a plugin should handle those DB changes. Let me think about that! Thanks.  
  
  ---
  
  