BACKUP YOUR DATA Occasionally, pieces of KHacc change in such a way that the saved datafiles need to be upgraded to continue to work. In the past, this upgrade was accomplished via an upgrade script that was distributed with the new program. This process worked reasonably well, but did occasionally hickup when the given interpretter was missing, or incompatible with the script itself. Also, because they were a shell scripts, they tended to be a little--how should we say?--obtuse. BACKUP YOUR DATA The solution is a plugin that can provide the same functionality. It avoids the shell script problems because if KHacc can be compiled, so can the plugin. The plugin can be a bit more straightforward than the shell scripts as well, because they can utilize the QHacc engine instead of just trying to decode the datafiles. It also brings the upgrade procedure into line with other QHacc-related processes, because it operates as an argument to the KHacc executable instead of a totally separate procedure. BACKUP YOUR DATA So now that you know why the upgrade plugin exists, how do you use it? It's a bit of a mix of KHacc and QHacc, because QHacc supports all the command-line options necessary for the upgrade. Here are the steps, assuming you're using the bash shell: BACKUP YOUR DATA o BACKUP YOUR DATA o Figure out where your KHACC_HOME is (khacc --showhome 2>/dev/null). o Restore any archives you have taken. The upgrade plugin may change the structure of the datafiles, which can in turn affect the structure of the archived files. If you don't restore the archives before upgrading, the archives may not be compatible with the new files, so later restoration may lead to undefined results. o Export your data (qhacc -f KHACC_HOME --export /tmp). The upgrade plugin only works against QHacc's native file format, so if you use some other database, you must create a native export. o Run KHacc with the upgrade plugin as its home (khacc -f UPG:/tmp). This will upgrade your old data and start a new instance of KHacc for your review. If everything looks good, save and close the application. o Recreate your datastore (qhacc --create PSQL:dbname=khacc). This is a good practice for all upgrades because the upgrade process may change the structure of the data. If you use a database backend, for example, the table structures may change, and these changes must be accounted for. If you are using regular old files, back them up and delete them to clear out the old, un-upgraded data. Then, recreate them. o Export your data to your datastore (qhacc --home /tmp export KHACC_HOME). This completes the upgrade. Note: You can import the upgraded data from the upgrade location or export it to your KHACC_HOME. Both will do about the same thing, but the import operation takes longer because it will check for duplicates.