Backups and Restores
NOTE: Depreciated. Bacula is no longer used.
Table of Contents
Bacula
Bacula provides the backup services for servers in MT. Bacula consists of the following components:- bacula-sd(storage daemon)
The storage daemon is running on kitkat and uses /export/bacula, and the USB dock as the storage locations. The CopyToDock job is not yet working(as of 5/27/2015). - bacula-fd(file daemon)
The file daemon runs on any client that has files to backup. - bacula-dir(director)
The director, which controls the backup service, runs on chickostick. The catalog(database for bacula), runs on chickostick's PostgreSQL service. - bconsole
The Bacula console is the frontend to the director, and any client that has a bconsole.conf with the correct connection settings for communicating to chickostick's director will be able to use bconsole from local terminal. - bat
bat is a GUI client that is good at giving a general overview of the current Bacula environment. It is somewhat limited and many operations should not be done from this program. Port 9101 has been opened and pointed towards chickostick for this purpose.
Backup Procedures
Backups are grouped by clients and jobs, stored in volumes which are grouped in pools and labeled accordingly, and scheduled in cycles. Details are in poprocks /etc/bacula/bacula-dir.conf, essentials available via bconsole. Manually running a backup job is a rare occurrence, but can be done via 'run' in bconsole.
Offsite Backups
Kitkat
- Manual mount and umount required for dock drive
- fstab setup need only mount /mnt/usb
Chickostick
- bconsole
- Need to create a new label or job will error "Cannot find any appendable volumes."
- label
- 2: DockFile (/mnt/usb)
- VolumeName: DockFileMMDDYY
- DockPool
- run job=CopyToDock
- Job currently takes about 5 hours and KitKat is is the only server that will have any major impact so job can be done during normal business hours
- create a database dump on chickostick after backup complete
- chickostick:/etc/bacula/scripts/make_catalog_backup
- scp chickostick:/export/bacula/catalog.db to kitkat:/mnt/usb
Restore Procedures
Bconsole 'restore' command, select jobid for the client. For pvsadmin, backups are for client kitkat-fd, and file is pvsadmin.lite.db (or use job PvsadminLite) (lite because zip2district and addr2zip are empty)
Database Restores
For database restores of deleted items, use a clean restore schema (or at least specify clean in pg_restore command). /export/bacula/restore/restore_tables.* has groups of tables that frequently need to be restored together.
Example for restore of deleted sig data:
root@kitkat:/home/clinton# cat /export/bacula/restore/restore_tables.sig | while read table; do pg_restore -n public -t $table pvsadmin.lite.db \
| sed "s/SET client_encoding = 'UTF8'/SET client_encoding = 'latin1'/" | sed "s/SET search_path = public/SET search_path= restore/" \
| psql -h poprocks -Upgsql -1 pvsadmin ; done;
admin.votesmart.org[pvsadmin]# begin;
BEGIN
admin.votesmart.org[pvsadmin]*# insert into endorse SELECT e.* FROM restore.endorse e JOIN restore.sig USING (sig_id) WHERE sig_id = 1944;
INSERT 0 47
admin.votesmart.org[pvsadmin]*# in
sert into rating SELECT e.* FROM restore.rating e JOIN restore.sig USING (sig_id) WHERE sig_id = 1944;
INSERT 0 0
admin.votesmart.org[pvsadmin]*# insert into endorse_candidate SELECT e.* FROM restore.endorse_candidate e JOIN endorse en USING (endorse_id) JOIN restore.sig USING (sig_id) WHERE sig_id = 1944;
INSERT 0 96
admin.votesmart.org[pvsadmin]*# insert into sig SELECT s.* FROM restore.sig s WHERE sig_id = 1944;
INSERT 0 1
admin.votesmart.org[pvsadmin]*# insert into sig_categ
ory SELECT s.* FROM restore.sig_category s WHERE sig_id = 1944;
INSERT 0 4
admin.votesmart.org[pvsadmin]*# insert into sig_tag SELECT s.* FROM restore.sig_tag s WHERE sig_id = 1944;
INSERT 0 3
admin.votesmart.org[pvsadmin]*# commit;
COMMIT
| sed "s/SET client_encoding = 'UTF8'/SET client_encoding = 'latin1'/" | sed "s/SET search_path = public/SET search_path= restore/" \
| psql -h poprocks -Upgsql -1 pvsadmin ; done;
admin.votesmart.org[pvsadmin]# begin;
BEGIN
admin.votesmart.org[pvsadmin]*# insert into endorse SELECT e.* FROM restore.endorse e JOIN restore.sig USING (sig_id) WHERE sig_id = 1944;
INSERT 0 47
admin.votesmart.org[pvsadmin]*# in
sert into rating SELECT e.* FROM restore.rating e JOIN restore.sig USING (sig_id) WHERE sig_id = 1944;
INSERT 0 0
admin.votesmart.org[pvsadmin]*# insert into endorse_candidate SELECT e.* FROM restore.endorse_candidate e JOIN endorse en USING (endorse_id) JOIN restore.sig USING (sig_id) WHERE sig_id = 1944;
INSERT 0 96
admin.votesmart.org[pvsadmin]*# insert into sig SELECT s.* FROM restore.sig s WHERE sig_id = 1944;
INSERT 0 1
admin.votesmart.org[pvsadmin]*# insert into sig_categ
ory SELECT s.* FROM restore.sig_category s WHERE sig_id = 1944;
INSERT 0 4
admin.votesmart.org[pvsadmin]*# insert into sig_tag SELECT s.* FROM restore.sig_tag s WHERE sig_id = 1944;
INSERT 0 3
admin.votesmart.org[pvsadmin]*# commit;
COMMIT
Gotchas
Special datatypes, domains (such as flexdate) need to be created prior to the restore of any table using them.Online Documentation
bconsole.conf: http://www.bacula.org/5.0.x-manuals/en/main/main/Console_Configuration.htmlbacula-sd.conf: http://www.bacula.org/5.0.x-manuals/en/main/main/Storage_Daemon_Configuratio.html
Diagrams
Current Services

Current Jobs

Proposed Jobs

CategoryITDefunct