[HOWTO] Restoring automatic backups

Post Reply
User avatar
Site Admin
Site Admin
Posts: 10525
Joined: Sun Sep 12, 2010 10:32 am
Location: Siegum, Germany

[HOWTO] Restoring automatic backups

Post by Harry »

Whenever LapTimer discovers a problem with the current database, it creates an automatic backup or recovery version of this data first. In a next step, it tries to repair the active database. This step works in most cases but may fail nevertheless. In situations like this, LapTimer rolls back the current database to an empty database to allow the user to continue using LapTimer on track.

Reasons triggering database issues can be various and are mostly due to memory shortage or for certain crash patterns.

This How-To shows how to recover backups created using the "automatic backup" feature mentioned in the first section. Mostly, you can accomplish this yourself and don't need help from my side. In case you can't recover your data using the description below, please check viewtopic.php?f=8&t=679 for an alternative (but pretty labor intensive) approach.

The step by step description is iOS specific. For Android, the device needs to be rooted to allow access to the files in LapTimer's sandbox. Otherwise, the process is pretty much the same.
  1. Before you start, please make sure you export any laps you have recorded *after* the database reset so you can add them again later. Use the export to .hlptrl and make sure your data arrives in mail - i.e. the export has been successful.
  2. Make sure the LapTimer app is not alive and kill the process to be sure. To kill LapTimer, double press the home button, scroll to LapTimer, and swipe it to the to kill the process going on in background.
  3. To start recovery, start iTunes and connect your iPhone. You can browse through LapTimer's files as follows: select the iPhone in the top left, select Apps, scroll down to iTunes File Sharing, select LapTimer. In the bottom right, you will see all files sitting in LapTimer's Documents folder. NB: iTunes' scrolling behaviour is strange for this list... In case you can't scroll the list, move the cursor a bit out of the list and try again.
  4. The Documents folder will show lots of .pdb files representing your current database, and sub folders named "recovery*".
  5. Inspect the recovery directories for recent timestamps to identify a candidate for restore. Most probably you will find more than one of these folders. The newer they are, the more recent the data is. As recovery directories may have been created for your reset database too, make sure you check the amount of files / data too. If e.g. the latest restore folder has significant less database files than the one before, chances are good they do not include the data you want to restore.
  6. Before restoring, copy all .pdb files from the Documents folder to your desktop. In case the recovery approach does not work, it may be good to have this additional backup...
  7. Next, delete all .pdb, .pdb.save and .pdb.dirty / other dot files in Documents. Take care to find all the files named.
  8. Copy all .pdb files from the restore candidate up to the Documents folder.
  9. Finally, pray and start LapTimer. :-) Lap List should come up with the laps up to the automatic backup now.
  10. In case you have exported new laps in step 1, import these laps to have the complete set of laps available again.
I'm aware finding an empty database is shocking... The good news is that it is almost always possible to get data recorded back using this restore or the manual restore process linked above. I keep my fingers cross.

As a standard reminder: please export your full database to .hlptrl regularly. It is not complicated and far easier to restore than the pretty technical process outlined here.

- Harry
Image Image Image Image
Post Reply