For the Drupal sites I am working on I have a setup using three different stages:
- R&D site - This one is for both testing contributed modules and my own development.
- Staging - A virtual copy of the live site to make sure that the things from the R&D site will work. Also used for testing updates/upgrades to core and contributed modules before they go live.
- Live site - Simply the live public site where all ends up after passing the two above.
This works pretty OK and straightforward. Lately though I have been thinking about way how this could be improved and made easier.
Everyone within this industry fully understands that separating code, design and content will in the long run be very beneficial when it comes to future scalability and maintenance.
But when it comes to us who are doing the behind the scenes work in adding new functionality it still adds quite a lot of extra work in regards to keeping a "log" when, for example, a new module is added, how it is configurated, changes needed to the rest of the system to make it work seamlessly in the existing environment.
First it has to be tested, if contrib module, or developed in R&D. Often this involves testing several similar modules and/or combinations before the wanted end result is found. I would say most developers does not have the discipline to keep a complete log here as most of it will simply not be needed as modules gets excluded due to that the functionality wasn't the expected.
Then, when the desired, functionality is found it needs to be tested on the Staging site with an up-2-date copy of the live site.
And lastly when it has passed all QA it will be implemented on the live site.
Especially going from the R&D to the Staging server will require quite a bit of reversed digging to make sure that all configuration for the new features are correctly applied. This is where it will be needed to compile the log to get the receipt for the installation on the live site later on.
Configuration/Staging APIs
This got me to think -What if could simply export and import the configuration of a Drupal installation. Not just the complete one, but also on module level.
Some modules, such as Views, has this and it is a big time saver.
I can see three basic different levels of configurations needed:
- Drupal Core - Just the configurations done to Drupal core.
- Modules - Configuration for individual modules, with dependencies.
- Content - Such as a View or a content type.
Then it should also be possible to use combinations of this. It would even be possible to generate a Site Profile from here that will include all settings needed to go from the first development to launching a new site.
When importing it the the new, live, site the UI will use a wizard that will guide through all the unique settings needed for the live site, such as connection to database, domain and all other things that is unique for an individual site in each module such as the code for the Google analytic module if that is used.
With a Configuration API I believe this would be possible.
The API could even be set up so you can connect two or more sites to be synced directly. This could be done in several ways:
- Staging -> Live - This would both synchronise code and configuration. If a new module/theme/etc exist on the staging server but not on the live it is automatically uploaded.
- Multiple Front Ends - Same as the above, but when the main Front End server is updated it will in turn update the others.
As the live site will have ongoing content changes it should also be possible to sync it back to the staging server. Then when new features are developed and needed to be tested before going live it would be a snap to update the staging server to mirror the current live site and all its content.
I do see that this would be a big big task to get implemented, mainly due to that every module will need to support it in one way or another to make it work.
With something like this I can see a lot of benefits in the usability of Drupal and it would also provide a grate base for creating installation profiles.