<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>

CC BY-SA 3.0
2017-03-20T12:05:03.833Z
Individual websites shouldn't diverge from the blueprint. The 'standard functionality' should be very flexible.
Wieger Jelsma
CC BY-SA 3.0
2017-03-20T12:11:45.170Z
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.
Stephen Lewis
CC BY-SA 3.0
2017-03-20T16:14:12.770Z
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).
Wieger Jelsma
CC BY-SA 3.0
2017-03-20T16:40:21.703Z
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.
Stephen Lewis
CC BY-SA 3.0
2017-03-21T08:51:11.473Z
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!
Wieger Jelsma
CC BY-SA 3.0
2017-03-19T16:03:29.370Z
2017-03-19T16:03:29.370Z
Stephen Lewis
<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>

CC BY-SA 3.0
2017-03-20T12:12:29.753Z
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?
Wieger Jelsma
CC BY-SA 3.0
2017-03-20T12:13:57.460Z
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.
mbalparda
CC BY-SA 3.0
2017-03-20T16:11:37.453Z
But it's not only concerning files. Also some DB changes should be made. Craft doesn't have an API (yet).
Wieger Jelsma
CC BY-SA 3.0
2017-03-20T17:41:56.473Z
You can modify the DB from the PHP code, I think I'm missing something obvious.
mbalparda
CC BY-SA 3.0
2017-03-21T08:53:09.637Z
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.
Wieger Jelsma
CC BY-SA 3.0
2017-03-19T23:54:48.270Z
2017-03-19T23:54:48.270Z
mbalparda
<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>

<updating>
What is the best approach of updating existing Craft installs with new features?
# 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.  

---

