There are three approaches for deploying updates to Drupal sites - but don't worry, we'll make the choice super-simple in this tl;dr section:
- (Easy, risky) Edit the live site directly
- OK if your site does not receive much traffic and if you're OK with making publicly-visible mistakes
- Dangerous if you don't know what you're doing: if you delete something by accident, you may not be able to get it back
- To reduce the risk: generate a fresh backup before you start editing. Restoring the backup undoes your edits by rolling the site back to when the backup was created.
- (Easy, very low-risk) Blue/Green Deployments
- Create a Prototype: a copy of your Live site. Make your content and configuration changes there.
- Custom codebase only (optional): you can also deploy a new version of your site's code to the Prototype.
- When your changes are ready, promote the Prototype to Next, then promote Next to Live.
- Your old Live site becomes “Previous”. If something goes wrong, you can promote Previous back to Live.
- This only works if nobody changes the Live site while you’re working on the copy. Anything changed on Live during that time won’t be on the copy. See the Blue/Green deployments section below for more.
- Create a Prototype: a copy of your Live site. Make your content and configuration changes there.
- (Advanced, custom codebase only) Configuration-based deployments, AKA classic Drupal deployments
- Drupito also supports the classic Drupal deployment workflow:
- Make configuration changes locally
- Commit them. Create a tag. Push the tag.
- Deploy the tag to the live site. Import configuration.
- Drupito also supports the classic Drupal deployment workflow:
P.S. If you host a custom codebase, all 3 approaches support deploying backend code (i.e. git tags) to any environment.
Blue/Green Deployments
Blue-green deployments are a super-simple way to manage updates to your website, eliminating uncertainty and complexity.
They let you make changes directly to a copy of the live site and, when the changes look good, set that copy as the live site. No lengthy deployments, database updates, or config imports to worry about.
How it works in Drupito?
The classic Blue/Green model has two environments: blue (live) and green (the copy you work on). Drupito splits “green” into two stages for increased flexibility. Prototypes are for trying things out, and you can have several at once, one per idea, experiment or person. Next is the one copy you’ve chosen to go live. That way, experimenting never gets mixed up with what’s about to ship. Each environment has its own color in your dashboard:
| Environment | Color | What it is |
| Live | Blue | The site your visitors see. |
| Prototype | Yellow | A copy of Live where you make changes. You can have several. |
| Next | Green | The copy that’s ready to go live next. There’s only one. |
| Previous | Red | The site that was live before your last update. Your safety net. |
| Backup | Grey | Older sites kept for reference. |
A typical update looks like this:
- Create Prototype from your Live site.
- Make your changes on the Prototype: content, configuration, anything you’d normally do in the Drupal admin.
- Promote to Next when the Prototype is ready.
- Promote to Live. Next becomes your live site, your old Live site becomes Previous, and the old Previous becomes a Backup.
You don’t need to think about “content vs. config”. Just edit the copy of your website and make it your live site when you’re ready.
Need to go back? Promote Previous to Next, then promote Next to Live. Your earlier site is live again. This even works for a temporary marketing campaign: launch the campaign version, and when the campaign is over, bring back the previous version.
Marketplace sites vs. custom codebase sites
Blue/Green deployments work the same way on both. The difference is code:
- Marketplace sites: you change content and configuration on your Prototype. The code is managed for you.
- Custom codebase sites: you can also deploy a different version of your code (a git tag) to each environment. For example, you can test a new release on a Prototype while Live keeps running the current one. The code stays with that copy of the site as it moves from Prototype to Next to Live. Live always runs a tag, not a branch.
Who should use it?
Sites whose content updates can be coordinated, or are infrequent.
Who should NOT use it?
Sites whose data can change at any time, without the site editor's knowledge. For example, a store: when a visitor makes a purchase, it gets recorded in the Live site's database - and if you're fortunate, that can happen at any time! You don't want to replace the "Live" site with the copy of the site if it may be missing the user's purchase record.
Why would someone prefer it?
- It eliminates uncertainty: you see exactly what the live site will look like before deploying it. No brittle config imports, no discrepancies between environments, etc.
- It simplifies work: don't think about config versus content - just edit your site.
- It reduces risk: if you aren't confident in the changes you (or your AI) are making, this approach is for you. Edit away and try things out - your live site is not affected. And if you like the outcome, make it your live site.
Config-based deployments (Classic deployments)
Custom codebase plans only.
If you’re used to the classic Drupal workflow, it works on Drupito the way you’d expect:
- Make configuration changes locally and export them (
drush config:export). - Commit them. Create a tag. Push the tag.
- Deploy the tag from Prototype & Launch: press Load tags on the environment’s card, choose the tag, then press Sync code. Live only accepts tags; Prototypes and Next also accept branches.
- Import configuration from that environment’s site actions: choose Import Config. If your tag includes module updates, run Run DB Updates first.
You can combine this with Blue/Green deployments: deploy the tag to a Prototype, import config there, check it, then promote it to Next and Live.
Managing config on Drupito
Set your config directory in settings.php the way you're used to, using $settings['config_sync_directory'] = "../config/sync";
If you want different config per environment, per site, or even per site instance, you can do that too by leveraging any of the following variables in settings.php:
$drupito_platform['environment_id']; // The environment that a site instance is currently deployed to. See below for a list of values.
$drupito_platform['site_name']; // The site's machine name. Useful for managing multiple sites built from a shared codebase.
$drupito_platform['site_instance_id']; // The unique site instance ID. When using blue-green deployments, this value does not change between deployments.
$drupito_platform['codebase_id']; // Differentiates between hosting plans, e.g. when the same public or private repository is shared across multiple codebase hosting plans.For example, to turn off CSS/JS aggregation everywhere except Live:
if ($drupito_platform['environment_id'] !== 'blue_live') {
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;
}Because a site instance keeps its ID as it’s promoted, use environment_id for “where is this copy right now?” and site_instance_id for “which copy is this?”.
Values for environment_id:
For your sites:
blue_live: Live environment (aka Production).green_stage: Next environment (often called “Staging” or "Test").yellow_prototype: Any Prototype environment. To differentiate between Prototype environments, use$drupito_platform['site_instance_id'].red_rollback: Previous environment, the site that was live before your last promotion to Live. Allows rollbacks to be easy if needed.grey_backup: Backup, an older copy of the Live site. Previous becomes a Backup the next time you promote to Live. To retain or export one, generate a standard backup from this environment.
For marketplace listings you publish:
orange_starter: Marketplace Preview, the copy visitors preview and that new purchases start from.orange_next: Marketplace Next Release, the next version of your listing (its “Staging”).