Questions and Answers

0 Dislike

David Lomas

How to back up a hub

Following on from the brief email exchange about making backups of hubs, I wanted to start a Q&A here which might help others in due course too.

I think we agreed there are 2 parts to backing up – the MySQL DB and the file system. So, in turn:

1. MySQL – What options to pass to mysqldump? Here’s my starter for 10 – can this be improved on? We could use —lock-tables given that we know not all tables are InnoDB, but even then it doesn’t guarantee consistency between the DBs. Also, do we need everything, or just the ‘hubname’ and ‘hubname_metrics’ tables? Or even just the ‘hubname’ table – does it make sense to restore the metrics?

$ mysqldump —all-databases —single-transaction —create-options —add-drop-table

2. Filesystem – do we just need to back up the /var/www/hubname folder? Or are there other locations which would be needed to successfully restore if we had to start from a blank installation again?

Thanks,

Dave.

Report abuse

1 Responses

  1. 0 Like 0 Dislike

    Andrew Rakowski

    I agree that there should be some “Hub backup” facility to insure that an active Hub can be restored without any inconsistencies in cases of system failure or other problems, as right now, there’s nothing we can do besides backing up the MySQL databases and filesystems. I have not experimented with failures and recovery, so I have no idea if a Hub could be rendered permanently unusable due to inconsistencies, but that’s a scary thought for a production Hub.

    At the moment, I’m using the package “automysqlbackup” from the standard Debian repositories for database backups. By default, it will create daily, weekly, and monthly compressed mysql dump backups of every MySQL database on the system after installing it. For filesystem backups (of /var/www/hubname and everything else), I’m using a home-grown system based on dump, but these are not synchronized (except roughly) with the MySQL backups.

    Having a tool to validate a restored Hub would also handy. Right now, we can restore a filesystem, restore MySQL databases, but have no guarantee of consistency or correct operation. A HubCheck (hzck?) that looks for orphaned objects, missing links, etc. would be very useful. I suppose I should add requests for “HubExport“ and “HubImport“ to the wishlist. :-)

    Reply Report abuse

    Please login to answer the question.

  • Copyright © 2022 Hubzero
  • Powered by Hubzero®