Language:


Journaling - Applying the Journal

If you need to revert to an old database, follow these steps:
  1. The old database must be one that was created after you started journaling. If you are using the database duplication feature, the most recent database copy will be named "HANSA.HDB.COPY".

    Before reverting to this old database, you may wish to check that it does not contain the damage that caused you to revert to it. You must carry out this check using a copy of the "HANSA.HDB.COPY" file and a copy of the "J0000001.HJN" journal file. If you use the "HANSA.HDB.COPY" file itself for this check, you will no longer be able to apply the journal successfully because you will break the synchronicity between the database and the journal. You must not even open the "HANSA.HDB.COPY" file or log in to it, let alone save any records before applying the journal.

    To carry out this check, place a copy of the "HANSA.HDB.COPY" database in the folder containing the HansaWorld Enterprise server application and ensure it is named "HANSA.HDB". As this database was created after you started journaling, a "J0000001.HJN" journal file must be present in the "journal" folder when testing. This must be a copy of the journal file, because anything that you save when testing will be added to this file.

    !

    Make sure you have an untouched "HANSA.HDB" file and journal file at all times.

  2. When you are sure that the "HANSA.HDB.COPY" file does not contain any damage, place it in the folder containing the HansaWorld Enterprise server application and ensure it is named "HANSA.HDB". Remember that this must be a database that is untouched by any testing. Similarly, the "J0000001.HJN" journal file in the "journal" folder must also be one untouched by any testing. It is recommended that you keep copies of both files, at least until you are sure the journal has been applied successfully, in case of a power failure or hardware problem occurring while the journal is being applied. Then, launch the command line application on the server by typing:
    ./HansaWorld --apply-journal &
    Starts the HansaWorld Enterprise server application and imports everything in the journal file that is not already in the database. The application will then quit.
    Again, if you are using the service application (Windows) or GUI single-user application, you will need to place the --apply-journal parameter in the "parameters.txt" file before launching the application, and to remove that parameter from the "parameters.txt" file when the application quits.

    !

    You must apply the journal immediately after reverting to the copy. If you open the copy and allow users to log in before applying the journal, the data in both the database and the journal file will be corrupted.

  3. Restart the command line or service application in the usual way. After logging on from clients, every change will, as before, be saved in the database and in the “J0000001.HJN” file.
---

In this section:

See also: