Content: Blog

Backups on Divio Cloud

Daniele Procida

May 11, 2017

An easily-managed backup history is part of every Divio Cloud project.

Everyone who works in computing has learned the importance of saving their work and keeping good backups. This includes saving the history of your work, so that you can wind back in time to an earlier state and restore it.

The Divio Cloud platform is designed to make it as easy as possible to backup your work the right way.

A backup system that doesn’t get used is useless.

Our backup system is designed with pragmatic, real-world needs and concerns in mind. Whether triggered on-demand or according to a schedule, the process is  automated, on the basis that the more effort it is for the user, the less likely it is that the backup will actually be made.

A backup system that interrupts the workflow or train of thought of its users provides security at such an expense that users will sometimes prefer to take a chance rather than make use of it. Ours runs in the background, without interrupting anything. Our on-demand backups are right at the user’s fingertips at the moment they’re most likely to want to trigger them.

The project-centric approach of our cloud platform allows us to make performing backups easier, faster and less intrusive than the backup-the-entire-filespace a typical VPS will offer - and easier, faster, less intrusive backups are far more likely to be done.

It also means that we can offer very generous scheduling and retention policies, because the burden of backing up on our infrastructure is much lighter.

What’s backed up?

The three components of a Divio Cloud project are its:

  • codebase - the files containing application code, configuration, frontend styling and JavaScript and so on
  • database - in our case, the Postgres database that Django uses for persistent storage
  • media files - files uploaded/processed/stored by the project’s applications

Given all three of these, your project can be re-created anywhere, from your own desktop to another hosting platform. In the absence of any one of them, you no longer have a project.

The codebase is already versioned in Git - every code change that is pushed to the server is recorded as a step in its history, and your code’s history can be rewound to any of those steps in its past. That history is shared wherever your code is saved: on our system’s Git server, your computer, even on another Git server if you choose to use one.

As well as making recordings of state automatically while you work, this provides a very detailed and granular history. It works very well for code and other text-based data.

It’s less suited to other data however, such as media and database files, which tend to be much larger and more monolithic. For these we have to take a more traditional snapshot approach, that record the entire database or media filesystem in a byte-for-byte copy.

Since project code is so lightweight in comparison, when we perform backups we actually include all the code as well,  giving you a complete backup for your entire project.

The backup is a compressed archive that, when expanded, contains all you need to recreate your project, and if you so wish, deploy it on another host. This is in accordance with our principle that a project on Divio Cloud belongs to you, and should be as open and portable as possible, so that you can sign up to our services confident that you will never find yourself locked in to them.

Infrastructure backups

We also maintain our own backups, of everything, independently of project backups.

Databases and project code across the system are backed up continuously, and media files are versioned. We’re able to take any project in the system or any part of the system back to a precise moment in time if required.

These backups are not part of the user-accessible regime, but they provide an additional layer of security. Even if a user somehow managed to destroy all their own backups, and accidentally delete a project or a part of it, our infrastructure backups would be there to fall back on.

Automated and on-demand backups

Backups are initiated in two different ways:

  • automatically, according to a schedule
  • on-demand, when the user requests it

Scheduled backups (for Managed Cloud plans)

Scheduled backups of the Live server are provided on our Professional and higher (Business, Business Protection+) plans. Scheduled backups are created daily on all these plans, but they have slightly different retention policies.

Enterprise plans can have custom schedules and retention policies to meet customer needs.

Scheduled backup retention policies

Scheduled backups are retained according to the following scheme:

  • Each daily backup  is retained for a week - in other words, you’ll always have access to daily backups from each of the past seven days.
  • After seven days, the last backup is retained for four weeks - so you’ll also have access to a series of weekly backup covering the last four weeks.
  • Each month, a backup will be retained for a year - giving you a series of twelve backups for the previous year (Business Protection+ plans only).

Backup on demand

You can initiate a backup on-demand, either as part of a deployment or simply to save a database/media snapshot, whenever you need, and as often as you need. We’ve made it as easy as possible, so if you’re in any doubt, just perform a backup.

If you are working with data that you can’t afford to lose, or on your live site, it’s strongly recommended that you select the option to make a backup when you perform a deployment.

People rarely regret having made a backup.

On-demand backup retention policies

Although you can make as many on-demand backups as required, we don’t keep them all indefinitely. Retention policies depend on the project plan:

  • All backups are saved for 24 hours.
  • The latest three (Free and Personal plans) or five (Custom and higher plans) for each server, Test and Live, are saved for 30 days.

This is of course in addition to any scheduled backups that have been made.

Encrypted backups (for Managed Cloud plans)

Encrypted backups are available on request for Managed Cloud projects.

Restoring from and using backups

All the backups retained on a project are available from the Control Panel, and can be downloaded or restored with a click.

It’s also possible to upload a backup to the Cloud, and then apply it to the Live or Test  server.

If you inspect a downloaded backup, you’ll find that it contains:

  • a SQL database.dump file of the Postgres database
  • a compressed archive of the media files
  • metadata files describing the project
  • in the boilerplate directory, the entire Docker-based project, that you can use to recreate by deploying on your own Docker host.

User-oriented, real-world data security

The Divio Cloud backup system is not an afterthought, bolted-on to our platform.

It’s a key part of the architecture, used not just for the backups that our users rely on, but also as part of our own deployment processes. It has been designed from the ground up to be efficient and economical with resources, and to run swiftly, because it’s run many times each day.

At the same time, it represents the principles that are central to our platform: it’s open, because we believe your work belongs to you; it provides practical, real-world security and confidence in the integrity of your data; and it’s thoroughly user-oriented, because only tools that work the way people need them to work can be relied upon to fulfil the promises of them.

If you're already a Divio Cloud user, you'll find your projects' backups via the Backups menu.

If you're new to the platform, you can see how it works for yourself at any time and explore all its features, including backups and other key functionality, at no cost. A Divio Cloud account is free and takes only a moment to create.

Try it now