Backing Up Monica
by Frank McPherson Tuesday, December 19, 2017

Yesterday I did more research about backing up or exporting the data that I put in to Monica. Monica does have an Export Data function that exports to SQL. From what I can tell, it creates an extract or copy of the MySQL database. 

The problem is that Monica doesn't have an easy way for importing data back in. The Import Data function exports the vCard format to provide a way to move data from Google and Outlook to Monica. The export function is intended for moving from the hosted version of Monica to your own instance and the developers assume that if you ware going to host Monica then you will know enough about MySQL to figure out how to import the data, but I don't, yet. I've entered a feature request to provide a way to backup data.

Another option is to backup the server, and for that I can use Lightsail's instance snapshots. It is pretty easy to create a snapshot, either using the portal of the AWS CLI, but if I were to go this route and I wanted regular backups I would need to do scripting to create a snapshot on a nightly basis. 

The other concern I have with snapshots is that I can't tell how much I am going to be billed for them. Amazon says it will charge $0.05 per GB month for storage, and if you only have one snapshot then you pay for the entire disk. Subsequent snapshots are only charged for deltas. Consequently, the baseline snapshot of the 20 GB disk cost me $1.00 per month, subsequent deltas may cost pennies.

For the moment, creating Lightsail instance snapshots appears to be the simplest approach to backing up data. I have found an AWS Lambda script that automates the creation of snapshots.