KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Rollback on any log file
PRODUCT: 4D | VERSION: 14.3 | PLATFORM: Mac & Win
Published On: April 10, 2015

If a serious problem occurs and the datafile gets damaged, when the database is reopened 4D will ask whether to automatically restore the last backup and incorporate the latest transactions from it through the log file. The database then opens up normally and the current log file is the one which was the current one at the time of the crash. The administrator can then perform a "rollback" of any operations performed on the data file from the backup, such as undoing a deletion of records.

Generally, a "rollback" can be performed on the current log file, but not a backup of a log file. Any backup of a log file in the drop-down list of MSC can be selected to consult the list of operations, but the rollback function is disabled. This is normal behavior because this feature has not been implemented yet.

If needed there is a manual procedure to perform a "rollback" on any log file. The general idea of this procedure is:

   - Make any log file the current log file
   - Cancel an operation from any log file

There are two types of files, these steps will make the file the current log file allowing "rollbacks" to be performed:

The Current Log File ('.journal')

   1) Restore the last backup ("4BK".) to a new folder via the "File -> Restore" menu of 4D or via the MSC:

      - Delete all files and folders except the data file (".4DD")

   2) Go to the folder of the current database and copy the following files and folders in the backup restored folder:

      - the "Preferences" folder containing the "backup.xml" file

      - the structure file ".4DB"

      - the last backup files ".4BK" and ".4BL"

      - the current log file ".journal"

   3) Rename the current database folder (add "_old" at the end, for example)

   4) Rename the backup restored folder as the original current database folder

   5) Open the Database

A Saved Log File ('.4BL')

   1) Restore the log file (".4BL") number N into a new folder

   2) Restore the backup (".4BK") number N in the same folder via the "File -> Restore" menu of 4D or via the MSC:

      - Delete all files and folders except the data file (".4DD") and the log file (".journal")

   3) Restore the backup (".4BK") number N +1 in a new folder and copy the following file and folder in the backup restored number N:

      - the "Preferences" folder containing the "backup.xml" file

      - the structure ".4DB"

   4) Copy backup (".4BK") number N in the backup restored number N

   5) Copy the backup log file (".4BL") number N-1 in the backup restored number N

   6) Rename the current database folder (add "_old" at the end, for example)

   7) Rename the backup restored as the original database folder

   8) Open the Database