Reset Bacula database and files
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDQEt33UNjdIEeFi5NEnMXhLxctlAYCSI2rdEX9KdV_1IGmDZSZ3oJNIDxLJdwXwZ3H97TXjsfTk_ueQ5bZVKdHg_dHTw2Ma9spJoOiANa2igqHkTVtZtIl6ti67AlD1kZMs8eShnQaqA/s320/harddrive2-icone-8520-128.png)
Today I need to purge my bacula for several reasons. Here is how I did. First backup the database and files used in your previous setup, one never knows you might actually need it after the purge... /usr/bin/mysqldump -aecqQ bacula > bacula_before_purge.sql and copy the volumes and bsr files. Stop bacula : service bacula-director stop service bacula-fd stop service bacula-sd stop then : mysql -u root -p drop database bacula; create database bacula; quit next we need to recreate bacula tables. There's a bacula script to do that, but the file needs to be changed to set the correct database name. cp /usr/share/bacula-director/make_mysql_tables ~/ vi ~/make_mysql_tables change XXX_DBNAME_XXX by your bacula database (let's say 'bacula') save and exit. then run as root the script ~/make_mysql_tables it should have recreated the tables : mysql -u root -p use bacula; show tables; +------------------+ | Tables_in_bacula | +-----------