How to schedule backups for development, testing, and production environments?
Asked Answered
P

2

0

I was educating myself about website launches. I was reading this document to prepare an implementation check-list for my future website launches.

On page 11, they mentioned

Schedule backups for development, testing, and production environments

I can imagine taking backup of a database and website code.

How can someone automate and schedule backup of an entire x, y or z environment?

If this is a very broad question then I do not need the step by step document for doing this. Maybe some starting point which help me imagine this will be good enough.

Update:

I have sent an inquiry to Pantheon looking forward for their response.

Pique answered 28/11, 2015 at 6:53 Comment(0)
H
1

It all depends on how you set up your environments, how complex they are, and what you are trying to back up.

How often do your environments change?

You can use something like Docker to keep track of the changes to your environments. It basically gives you version control for environments.

If you're using a hosting provider like DigitalOcean, they provide snapshots and backups of entire virtual images.

Read about rsync - https://wiki.archlinux.org/index.php/Full_system_backup_with_rsync

You could use rsync if you manually keep track of all of your config files and handle the scheduling and syncing yourself.

As for the actual site:

What's changing on your sites?

For changes to the code of a site, you should be using version control so that every single change is backed up to a repository like Github.

Most of the time though, the only thing that is changing is data in a database. Your database can easily be managed by a third party like Amazon RDS who offers automated backups. If you want to manage your own database on your own server, then you can have a cron job to automatically perform a backup of your database at scheduled times. Then you can use rsync to sync that backup to a separate machine. (You want to spread your backups across a couple of machines in different locations)

Hutment answered 28/11, 2015 at 7:25 Comment(2)
Thanks @EricIlhi - Docker looks close to what I was trying to understand. Is GitHub not a version control system itself?Pique
Github is just a repository. It's a server. They host a Git (git-scm.com) server. You could host a Git server at your school, home, wherever. Then, using Git, you could push code from anywhere to that server, and pull down from that server to anywhere.Hutment
C
1

You can run cron jobs at regular interval to backup your data. The most important data could be your transactional information or the entire database itself.

Code, you can manage at developers end using github. But if you have certain folders which are populated by website users, then plan to backup those as well.

Courtenay answered 8/12, 2015 at 12:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.