[Sugar-devel] backups

Tabitha Roder tabitha at tabitha.net.nz
Sat Aug 14 16:57:30 EDT 2010


On 12/08/2010, S Page <skierpage at gmail.com> wrote:
> Interesting!  I think Journal backup to the school server has been a
> feature since XS 0.4 and Release 8.2, see
> http://wiki.laptop.org/go/XS_Blueprints:Datastore_Simple_Backup_and_Restore
> , and that's what your picture shows.  I assume you're referring to
> the recent Sugar work (I think
> <http://lists.sugarlabs.org/archive/sugar-devel/2010-June/025094.html>
> that has added backup to locally-attached volumes.

We just upgraded half the Samoan deployment using this feature to
restore their work. They were on 8.2.0 (build 767) so I wrote a backup
script which simply makes a tar file on the usb:

#! /bin/sh

SERIAL=`cat /ofw/serial-number`
BACKUP=`dirname "$0"`/backup

mkdir -p "$BACKUP/$SERIAL"
cd /home/olpc/.sugar/default
tar -czf "$BACKUP/$SERIAL/datastore.tar.gz" datastore
echo backed up journal to $BACKUP/$SERIAL/datastore.tar.gz

Put that file on a usb stick, insert into the XO and run the script
(when doing a mass upgrade, ctrl-alt-neighbourhood gets to a terminal
quickly). The tar file on the usb contains the whole journal. The
dextrose restore will load it, but there is a bug if you are coming
from early builds, see http://bugs.sugarlabs.org/ticket/2149 and an
additional bug which I haven't reported yet (migration fails if an
entry in in the source journal doesn't have a preview). Migration
isn't perfect, but record photos and write documents survive fine.

If you want to restore to a different xo, change the serial number of
the tar file. You should be able to restore manually if your
destination build doesn't have a restore feature, just replace the
datastore directory with the one in the backup and ctrl-alt-erase
restart (I'm not sure how safe this is, the running system may try to
write to the "old" journal during the shutdown, migration happens on
startup).

Tom


More information about the Sugar-devel mailing list