Question about Backups

Does the backup service backup data only (files, db) or does it backup the entire disk image? I guess what I'm getting at is - when you restore from a backup, will the server configuration come along with the backup? Or will I have to re-configure everything before restoring?

7 Replies

A backup includes all disk images and configuration profiles, so when you restore, you get them all back (and in fact, can't select a subset, it's always the entire thing).

Technically, the disk image backups themselves are file based, so you need to stick with a supported filesystem (e.g., create the image via the Linode Manager) or else the backup system won't be able to function.

Essentially it supports a "bare metal" (or bare VPS) restoration (and in fact does not support per-file restorations). If you were to create a new Linode, restore a backup, and then boot the configuration profile, your Linode would be back to the same complete state it was in as of the backup.

When you restore, the restoration configurations/images are all given a prefix of "Restore ####" so you can restore to an existing Linode as long as you have space, and then make any adjustments you may wish. The disk images will be only slightly larger than needed for their files, so not their exact original size, but you can expand them afterwards. That also helps with a restoration potentially fitting on a Linode that already has a configuration.

– David

Thanks for the info.

you should still dump your database every day.

here's my script to do that, cron runs it every morning

#!/bin/bash

for a in `seq 8 -1 0`; do
        mv /var/backups/mysql/mysqldump.sql.$a.bz2 /var/backups/mysql/mysqldump.sql.$[a+1].bz2
done

/usr/bin/mysqldump --events --all-databases > /var/backups/mysql/mysqldump.sql.0
/bin/bzip2 -9 /var/backups/mysql/mysqldump.sql.0

that will keep about 10 copies of your database on disk, so if it's a large database, it might not fit. you can change seq 8 -1 0 to (eg) seq 3 -1 0 to keep about 4 copies.

@chesty:

#!/bin/bash

for a in `seq 8 -1 0`; do
        mv /var/backups/mysql/mysqldump.sql.$a.bz2 /var/backups/mysql/mysqldump.sql.$[a+1].bz2
done

FWIW, in bash you can replace most uses of 'seq' with brace expansion - even if spawning an extra process is no problem, it may be easier to read. Your first line would look like:

for a in {8..0}; do

Also note the square bracket syntax for arithmetic expansion is deprecated in favor of $(( … )). There don't seem to be any plans to remove the older syntax, but something to keep in mind when writing new scripts.

Also note that mysqldump locks databases/tables which will effect your application. If you're using innodb you can run mysqldump –single-transaction and it'll run the entire dump in a single transaction and not lock your database/tables.

Or if you're using myisam you can just cp the files, it's how mysqlhotcopy works.

@shippinpie:

What are the downsides of utilising –single-transaction?
None apart from it only works with innodb.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct