My version of Agenda is now at the point where I can enter items into a file, creating categories as I go. The basic structure is in place, and the specific fields are extensible. I plan to keep improving the code over the next few months, with priority to specific functions as I need them.
But before I trust this program with my precious data, I want a backup utility.
Backing up my version of Agenda is going to be complex, for a few reasons:
- I'm using a database that contains multiple 'workbooks', instead of the single-workbook text files that the original Agenda used. But I don't want to back up the whole database (that happens anyhow on a scheduled basis). I want to take a snapshot of a specific workbook, that I can restore later. This means extracting specific records from the database.
- I want to be able to restore a copy of a workbook beside the original workbook in the database, so I can't rely on unique keys being unique unless I recreate them. I need to handle the records intelligently.
- My version of Agenda supports 'attachments', such as PDF files. If I back up a workbook, I expect the attachments to come with the backup. This means that I need to create a ZIP file or similar, not just a set of SQL statements that I can present as a text file (the usual way of backing up a Joomla database).
- The text editor that I am using for Notes allows inserting images. Most images are 'local' - they are uploaded and then linked from the server rather than from a remote site. I'd really like the images to be scooped up and added to the backup - if I restore into a different environment or directory structure, then the images may not be there or the links may be broken. So I want to scan all Notes, grab any inserted images, and stick them into the ZIP file..
The 'broken link' problem is also true for remote links to other web pages - both images and ordinary URL links - but I think they are less likely to cause a problem. In any case, I can't backup entire web pages that have been pointed to.
Backup and Restore will be a big component of the new Agenda. It has some design implications to how I support uploading attachments and images, so I'm going to have to make some changes to existing code.
For now, I'm running my Agenda on my laptop. When I move it to a proper web server, I'll want to backup my local workbooks and restore them on the real server. And if anyone uses my Agenda on that server, they may eventually want to back up their data and move it to another instance of Agenda that they host themselves.
My Agenda is usable - barely. I'm keeping some 'ideas' and 'todo' items in it. But until I have the ability to backup, I won't use it for anything important.
So backup is what I am working on now.
0 comments:
Post a Comment