dinsdag 1 november 2016

Reset(clear) Bareos Storage and database

If like me you just learned bareos and tested around a little, and you are now ready for production, follow the stept below to clear your bareos setup and you can start from scratch without having to reconfigure.

Reset Bareos (delete storage and clear database):

Stop all Deamons:

service bareos-dir stop
service bareos-fd stop
service bareos-sd stop

Remove all files:

rm -Rf /var/lib/bareos/storage/
rm  /var/lib/bareos/*

Drop database

cd /usr/lib/bareos/scripts
./drop_bareos_database

Create database

./create_bareos_database
./make_bareos_tables
./grant_bareos_privileges

Restart services

service bareos-dir start
service bareos-sd start
service bareos-fd start

4 opmerkingen:

  1. Deze reactie is verwijderd door de auteur.

    BeantwoordenVerwijderen
  2. Does this work with Bareos 16.2 since somee change where added?
    Thanks!

    BeantwoordenVerwijderen
  3. Hi Stacey, This indeed works with Bareos 16.2 as well.

    Do please note that the storage directory's in his example might be different from your storage. Basicly these commands delete all databases and rebuild them from scratch. And you need to delete all previously created volumes as well to prevent any errors later on. Success!

    BeantwoordenVerwijderen
  4. For dropping and creating database - For me root had no privileges so first su - postgres

    BeantwoordenVerwijderen