Scenario 4: Restoring files from the previous backup job using Bconsole
Bacula Enterprise offers users the opportunity to mix and match user interfaces to the users preferences whether this be GUI (scenarios 1 and 2), command line with bconsole (scenario 3), scripting, or API. This scenario demonstrates using bconsole, the Bacula command line administration tool, to perform a manual restore job. Please be sure to complete Scenario 3 first, to ensure you can follow along.
- To access bconsole, ssh as root to your Bacula Enterprise Trial VM using “bacula” as the password.
- In bconsole, type ‘restore’ which brings up the restore selection window. Here you have many ways to find the desired backup job for your restore.
- Type ‘1’ to show a listing of the last 20 jobs run. Here you can see the jobs that have run recently on this director. If you have been following the trial scenarios, then likely you’ll see a jobid that corresponds to the Linux-etc files backup from Scenario 3. In the screenshot below, this is JobId #3.
- Next, enter ‘3’ which prompts for the desired JobId(s) for restore, followed by the JobId. In this case, the JobId is also 3.
- Once the JobId is entered, Bacula builds a virtual directory listing of the files that were backed up in this job, based on the information in the catalog. The restore console’s ‘File Selection’ mode allows you to browse this directory and choose the files to restore. The ‘help’ command will show all available commands in the restore console. To restore everything, simply type ‘mark *’
- Once the files are marked, typing ‘done’ allows you to review the restore settings before running it. You can modify things like the restore path, the client where files will be restored, and the replace settings for existing files.
- Type ‘mod’ and then select item ‘11’ to change the ‘Replace’ options. This sets the rules that Bacula will follow if it finds existing files in the restore directory. Change to ‘always’ by selecting option ‘1’.
- Type ‘yes’ to begin the restore, and then ‘messages’ to review the job log as it runs. Once complete, the job log should say ‘Restore OK.’
- To verify the restore, type ‘exit’ to leave bconsole, and then ‘ls /tmp/bacula-restores/etc/’.
- Please pay attention to the space available in the Trial VM’s “/tmp” directory if you perform several restore jobs. After testing a restore, it is a good idea to delete everything under “/tmp/bacula-restore” and “/tmp/bacula-restores” to keep the VM’s “/” partition from filling to 100%.