Backup database

From HiveTool
Revision as of 03:18, 8 January 2014 by Paul (talk | contribs)
Jump to: navigation, search

These notes from discussions among hivetool developers are posted here to aid in collaboration, to serve as a road map, and to help orient new comers to the project.

Drupal security updates

drush (https://github.com/drush-ops/drush). Requires shell access. This tool will make security updates trivial. This tool will also save you tons of time. For example, a db backup is as easy as this: drush sql-dump —result-file=../today.sql

Backups

Start with simple backup included in the hosting package. Keep an off-site backup since often the hosting backup services backup onto the same machine your hosting/db is on. Amazon S3, or even glacier, do cost, but are cheap and dependable. A cron job can rsync weekly to amazon or to our own server.

  1. get backups setup using the existing hosting platform. We should also document how long and how often they do backups.
  2. Then let’s setup syncs from these backup locations to the media server when it’s available.


I spent some time exploring our backup options:

—Netfirms— They keep a backup on a mirrored server which is available if needed. There is a charge for this if you need something restored and there is not versioning of the backups- basically whatever they have on the mirror server is what you get. Optionally, you can pay 15.00 a year for local backups, which allows you to access versioned backups for the last 30 days.

They do not offer ssh access. For me personally, this is the first question I ask hosting companies- ssh is definitely a deal breaker for me. But you are already here so, I figure we make it work.

There is a drupal module: https://secure.netfirms.com/product/site-backups/index.bml that allows you to ftp files and db via a cron job. This may be the best option for offsite backups.

—Bluehost— They provide ssh access which provides many flexible options. - You can connect like this: ssh user@website.org

- I installed drush you can view the help by typing: drush (ensure you are in the ~/public_html dir when you run this).

- I made a backup of the database using: drush sql-dump --result-file=../drush-backups/drupal.sql you can then scp to another server and to restore: drush sql-cli < drupal.sql (much easier that dealing with phpmyadmin).

- we can easily rsync files and db to the media server when it becomes available.

- It appears you must upgrade to get the backups enabled: https://my.bluehost.com/cgi/bm/product 20.00 a year- not bad as it will allow us to keep versioned offsite backups i.e. weekly, monthly, etc. It says you do get a basic backup plan, but I could not find access to this. Perhaps you have to contact them for restores and we don’t have access to rsync the backups.

—My suggestions— - pay the $15 and $20 a year for local backups at each hosting company. - when you get the media server up, we can look at rsyncing offsite backups to this. Alternatively, since the data is so small, we could use Amazon S3- it should be less than $20.00/ year for total backup storage for the two sites. - If you plan to use Drupal in the future, it’s hard to imagine without drush and ssh access. Consider moving stuff from netfirms to bluehost? This is lower priority, but something to consider down the road.