Picture of Helen Bailey
Backing up course(s)
by Helen Bailey - Monday, 11 May 2015, 11:40 AM
 

What's the best way to backup my course now and then from the authoring tool? I realise as my development gets further along that if I did something stupid and ruined it in someway or the computer decided to pack up I'd lose all my work :/

Can someone tell me everything I need to backup so I can stop worrying!

Thanks, Helen

me
Re: Backing up course(s)
by Sven Laux - Monday, 11 May 2015, 1:18 PM
 

Hi Helen,

For now, there isn't any functionality built in and this needs a technical answer from one of the developers. (I hope someone else can help here)

However, we have been discussing course import/export functionality in our (still ongoing) prioritisation for v0.2 of the authoring tool and are hoping to be able to deliver this when the next big release is made. It would be great to canvas opinions from the community.

What are the key features we should prioritise? Is the ability to back up (e.g. via import/export) one of them?

Thanks,
Sven

Picture of Greg Pell
Re: Backing up course(s)
by Greg Pell - Thursday, 14 May 2015, 1:46 AM
 

Importing and Exporting of Courses would be a feature I would look at prioritising :)

Picture of Helen Bailey
Re: Backing up course(s)
by Helen Bailey - Thursday, 14 May 2015, 9:36 AM
 

I tend to agree that just having somewhere to save a version of my course that I'm happy with before embarking on a change would be great fun - was messing about in MongoDB this morning and it would help the worry that suddenly I load my course and it's completely vanished due to something I did!

Other than ideas for new plugins that I can think of, or issues with bundled extensions/components (most of which I have pointed out in various posts on here), in terms of the authoring tool it works very well in my opinion, the main thing I would focus on is the asset library. Being able to delete, replace and change the size of images in that order of priority iI think!

Hope that helps :)

Helen

 

Picture of Michael Memory
Re: Backing up course(s)
by Michael Memory - Saturday, 23 May 2015, 9:58 PM
 

Yes, backing up a course would be a nice feature to have. I have been looking into possible solutions in the meantime using MongoDB's 'mongodump' and 'mongorestore' commands.

The 'mongodump' command creates a single snapshot of the database, but I'm worried about repercussions with the authoring tool if I needed to import it back into place. I suppose that if I ever needed to reinstall the authoring tool, I would just name the new database the same name as the previous version, and then use 'mongorestore'. I'm trying to learn the ins and outs of 'mongorestore' to see how it reacts with data (i.e. what does it, or doesn't it overwrite when restoring).

In any case, it is a little scary thinking of starting a project without a stable way to back up the content.

As far as other items of importance go, I second Helen on the asset management. Similarly, it would be nice to be able to remove a theme altogether from the list of themes (not just disable it). On a previous installation I had several themes named 'test theme' that were forever there.

Thanks for all the good work!

Michael M.

Picture of Chris Zoellick
Re: Backing up course(s)
by Chris Zoellick - Tuesday, 26 May 2015, 2:18 PM
 

I am using a mongodump > git solution to give us somewhat of a safety net while developing our first courses in the authoring tool. 

I have the following script set up in a cron job that runs once an hour, so that if something caused us to lose data, or drove the need to roll back to an earlier point in time, we would have at least hourly 'snapshot commits'.

Here's my bash script in case it's useful to anyone: 

#!/bin/bash

cd /home/adapt/adapt_backups

mongodump --db adapt-tenant-master --out bson_backup

mongoexport --db adapt-tenant-master --collection articles --out json_backup/articles.json
mongoexport --db adapt-tenant-master --collection assets --out json_backup/assets.json
mongoexport --db adapt-tenant-master --collection blocks --out json_backup/blocks.json
mongoexport --db adapt-tenant-master --collection components --out json_backup/components.json
mongoexport --db adapt-tenant-master --collection componenttypes --out json_backup/componenttypes.json
mongoexport --db adapt-tenant-master --collection configs --out json_backup/configs.json
mongoexport --db adapt-tenant-master --collection contentobjects --out json_backup/contentobjects.json
mongoexport --db adapt-tenant-master --collection courseassets --out json_backup/courseassets.json
mongoexport --db adapt-tenant-master --collection courses --out json_backup/courses.json
mongoexport --db adapt-tenant-master --collection extensiontypes --out json_backup/extensiontypes.json
mongoexport --db adapt-tenant-master --collection menutypes --out json_backup/menutypes.json
mongoexport --db adapt-tenant-master --collection policies --out json_backup/policies.json
mongoexport --db adapt-tenant-master --collection products --out json_backup/products.json
mongoexport --db adapt-tenant-master --collection roles --out json_backup/roles.json
mongoexport --db adapt-tenant-master --collection tenants --out json_backup/tenants.json
mongoexport --db adapt-tenant-master --collection themetypes --out json_backup/themetypes.json
mongoexport --db adapt-tenant-master --collection users --out json_backup/users.json

echo "Done exporting!"

git add . && git commit -m "Automated backup `date`" && git push

Picture of Michael Memory
Re: Backing up course(s)
by Michael Memory - Wednesday, 27 May 2015, 4:19 AM
 

Thanks, Chris! That seems pretty bullet proof

Picture of Joannes Anthonius Rommers
Re: Backing up course(s)
by Joannes Anthonius Rommers - Monday, 1 June 2015, 2:04 PM
 

Hi Chris,

Works like a charm.
I do get a fatal error on that last line using git though:

#Start Script
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using
git remote add <name> <url>
and then push using the remote name
git push <name>
#End Script

Next to this I have a question on restoring the backed up information back into the database.
I do have access to the database via a client but what do you advice to put these bson or json files back into the mongo database?

Thanks!

Picture of Chris Zoellick
Re: Backing up course(s)
by Chris Zoellick - Tuesday, 9 June 2015, 3:42 PM
 

Hi Joannes,

You will definitely need to set up a git remote for this script to work. We use a private git server to post these to. 

 

Regarding the restore, that gets into mongo database administration and I would start with the mongo documentation for your version of mongo. Specifically to restore the dumped data in whole (be careful, you could lose data posted after your last backup) I'd recommend you start with http://docs.mongodb.org/manual/reference/program/mongorestore/.

 

Picture of Ulrich Kerzel
Re: Backing up course(s)
by Ulrich Kerzel - Friday, 29 May 2015, 9:33 AM
 

Hello,

 

yes, creating a backup or export would be great.

Many thanks

Ulrich