Foxhound 2.0 FAQ
Foxhound 2.0 FAQ Home      Foxhound Home      RisingRoad           Breck.Carter@gmail.com     


Question: How do I restore the Foxhound database from a backup?

Answer:

A typical Foxhound backup consists of a full backup of the database and log files, plus zero or more subsequent incremental log backup files, created by running the following shortcuts:

Foxhound2
   - Tools
      - Backup Foxhound Database
      - Backup Foxhound Transaction Log

Here is a step-by-step example of a Foxhound restore (for a detailed description of the restore process see this article Which log backups are required to restore a database?):

1. Verify that the full and incremental backup files exist; in this example there is a full backup of the database and log plus two incremental log backup files:

C:\ProgramData\RisingRoad\Foxhound2\backup\generation3\foxhound2.db
C:\ProgramData\RisingRoad\Foxhound2\backup\generation3\foxhound2.log

C:\ProgramData\RisingRoad\Foxhound2\backup\generation3\logs\111124AA.log
C:\ProgramData\RisingRoad\Foxhound2\backup\generation3\logs\111124AB.log
Note that the latest backups are always placed in the "generation3" folder; earlier backups may be found in "generation2" and "generation1".

2. Copy the full backup database file from the "generation3" folder to the main "Foxhound2" folder:

From: C:\ProgramData\RisingRoad\Foxhound2\backup\generation3\foxhound2.db

To:   C:\ProgramData\RisingRoad\Foxhound2\foxhound2.db

3. Prepare a command file to apply all the transaction log files that exist in the "generation3" and "generation3\logs" folders:

"%SQLANY12%\bin64\dbsrv12.exe"^
  -gn 120^
  -o C:\ProgramData\RisingRoad\Foxhound2\foxhound2_debug.txt^
  -oe C:\ProgramData\RisingRoad\Foxhound2\foxhound2_debug_startup.txt^
  -on 1M^
  C:\ProgramData\RisingRoad\Foxhound2\foxhound2.db^
  -ad C:\ProgramData\RisingRoad\Foxhound2\backup\generation3
PAUSE
"%SQLANY12%\bin64\dbsrv12.exe"^
  -gn 120^
  -o C:\ProgramData\RisingRoad\Foxhound2\foxhound2_debug.txt^
  -oe C:\ProgramData\RisingRoad\Foxhound2\foxhound2_debug_startup.txt^
  -on 1M^
  C:\ProgramData\RisingRoad\Foxhound2\foxhound2.db^
  -ad C:\ProgramData\RisingRoad\Foxhound2\backup\generation3\logs
PAUSE

4. Run that command file; here are some excerpts from the foxhound2_debug.txt file:

I. 11/24 09:01:18. SQL Anywhere Network Server Version 12.0.1.3298 I. 11/24 09:01:18. Developer edition, not licensed for deployment.
...
I. 11/24 09:01:18. Starting database "foxhound2" (C:\ProgramData\RisingRoad\Foxhound2\foxhound2.db) at Thu Nov 24 2011 09:01
I. 11/24 09:01:18. Database recovery in progress
I. 11/24 09:01:18.     Last checkpoint at Thu Nov 24 2011 08:29
I. 11/24 09:01:18.     Checkpoint log...
I. 11/24 09:01:19.     Transaction log: C:\ProgramData\RisingRoad\Foxhound2\backup\generation3\foxhound2.log...
I. 11/24 09:01:20.     Checkpointing...
I. 11/24 09:01:20. Starting checkpoint of "foxhound2" (foxhound2.db) at Thu Nov 24 2011 09:01
I. 11/24 09:01:21. Finished checkpoint of "foxhound2" (foxhound2.db) at Thu Nov 24 2011 09:01
I. 11/24 09:01:21. Recovery complete
I. 11/24 09:01:21. Database server shutdown automatically after log applied
I. 11/24 09:01:21. Database server stopped at Thu Nov 24 2011 09:01

I. 11/24 09:01:29. SQL Anywhere Network Server Version 12.0.1.3298 I. 11/24 09:01:29. Developer edition, not licensed for deployment.
...
I. 11/24 09:01:29. Starting database "foxhound2" (C:\ProgramData\RisingRoad\Foxhound2\foxhound2.db) at Thu Nov 24 2011 09:01
I. 11/24 09:01:30. Database recovery in progress
I. 11/24 09:01:30.     Last checkpoint at Thu Nov 24 2011 09:01
I. 11/24 09:01:30.     Transaction log: C:\ProgramData\RisingRoad\Foxhound2\backup\generation3\logs\111124AA.log...
I. 11/24 09:01:32. Starting checkpoint of "foxhound2" (foxhound2.db) at Thu Nov 24 2011 09:01
I. 11/24 09:01:32. Finished checkpoint of "foxhound2" (foxhound2.db) at Thu Nov 24 2011 09:01
I. 11/24 09:01:32. Starting checkpoint of "foxhound2" (foxhound2.db) at Thu Nov 24 2011 09:01
I. 11/24 09:01:33. Finished checkpoint of "foxhound2" (foxhound2.db) at Thu Nov 24 2011 09:01
I. 11/24 09:01:33.     Transaction log: C:\ProgramData\RisingRoad\Foxhound2\backup\generation3\logs\111124AB.log...
I. 11/24 09:01:33. Starting checkpoint of "foxhound2" (foxhound2.db) at Thu Nov 24 2011 09:01
I. 11/24 09:01:33. Finished checkpoint of "foxhound2" (foxhound2.db) at Thu Nov 24 2011 09:01
I. 11/24 09:01:33.     Checkpointing...
I. 11/24 09:01:33. Starting checkpoint of "foxhound2" (foxhound2.db) at Thu Nov 24 2011 09:01
I. 11/24 09:01:34. Finished checkpoint of "foxhound2" (foxhound2.db) at Thu Nov 24 2011 09:01
I. 11/24 09:01:34. Recovery complete
I. 11/24 09:01:34. Database server shutdown automatically after log applied
I. 11/24 09:01:34. Database server stopped at Thu Nov 24 2011 09:01

5. Start the Foxhound engine normally.

See also...
How do I backup my Foxhound database?
How do I backup my Foxhound database on a regular basis?
How do the Foxhound backup shortcuts work?


This page was last updated on December 2, 2011. Foxhound 2.0 FAQ Home      Foxhound Home      RisingRoad      Breck.Carter@gmail.com