Bacula for Windows

Detailed guide for setting up Bacula backup on your Windows server.


Below are the instructions for installing and configuring Bacula for use with our system.

First, you need to log in to your server as the Administrator user or a user with equivalent privileges.

  1. Download and install the latest Bacula version from here.

  2. Create the folder C:\TEMP.

  3. Locate and open bacula-fd.conf. The file should appear as Edit Client Configuration in Bacula’s Start menu folder.

  4. Replace the entire contents of bacula-fd.conf with the following.

If your server is placed in Stockholm:

bacula-fd.conf
Director {
  Name = bacula01-fbg-dir
  Password = YourPasswordGoesHere
}

FileDaemon {
  Name = ds****-fd
  FDport = 9102
  FDAddress = 0.0.0.0
  WorkingDirectory = C:/TEMP
  Pid Directory = C:/TEMP
  Maximum Concurrent Jobs = 20
}

Director {
  Name = bacula01-fbg-mon
  Password = "4CbWhjnxrVUuRA0ZSljhByGPJtaoyPTVF"
  Monitor = yes
}

Messages {
  Name = Standard
  director = bacula01-fbg-dir = all, !skipped
}

If your server is placed in Falkenberg:

Replace YourPasswordGoesHere with a password you choose. Also, change ds****-fd to your server’s name, e.g., ds1234-fd.

  1. Restart the Bacula service.

  2. Add firewall rules for Bacula. Bacula needs to allow incoming traffic on port 9102 and outgoing traffic on port 9103.

Send a message to [email protected] containing the new password and a list of the directories you want to back up. Preferably in the format shown below:

Bacula and MSSQL

Backups with Bacula operate at the file level and read data directly from disk. For MSSQL, it isn’t always guaranteed that all data has been flushed to disk, and restoring the raw SQL data files doesn’t always work. Therefore, we recommend dumping the database to .bak files at regular intervals.

Below, we show an example of how you can schedule a database dump.

Create a file—or use PowerShell ISE—with the following content and save it as backup‑script.ps1.

How the script works

Note that this script is intended for MSSQL installations where the local administrator account has access to the database.

The first thing the script does is import the MSSQL module into PowerShell (if the module is not installed, the script will not work).

Next, it checks whether the folder C:\backup\MSSQL exists; if it does not, the script creates the directory.

Now onto something a bit more advanced. The script tries to determine the path to your database, but it doesn’t always succeed. This depends on how the installation was performed and which version of MSSQL is running.

If it fails, the script includes instructions on how to set the database path manually.

Once that’s done, it will locate your databases and dump them into separate  .bak files.

The script could be scheduled with the following instruction to save the database to a file every day at 23:00. To schedule the dump, open a command prompt and enter the following command:

Bacula and MySQL

Backups with Bacula operate at the file level and read data directly from disk. For MySQL, it isn’t always guaranteed that all data has been flushed to disk, and restoring MySQL’s raw data files doesn’t always work. Therefore, we recommend dumping the database to .sql files at regular intervals.

Below, we show an example of how you can schedule a database dump. Create a file with the following content and save it as backup‑script.bat:

How the script works

The script connects to the MySQL database and determines which databases should be backed up. It then creates a new .bat file (dump-database.bat) where each database becomes a separate job.

The new .bat file is placed in C:\Users\Administrator\ and is executed immediately after the first .bat file finishes.

An example of what dump-database.bat will look like:

This script could be scheduled with the following command to save the database to a file every day at 23:00. To schedule the dump, open a command prompt and enter the following commands:

Last updated

Was this helpful?