Backup/Restore Specific Data - AFS

AFS Backup and Restore

Product
AFS
AFS_Version
7.11
Category
Technical Notes
language
English
audience
public

To backup/restore the Back Office and Nerada database, perform the following procedure:

  1. Edit the my-data-config.yml file to only apply the backup/restore procedure to the bo and nerada datasets:

    roles:
    - name: bo
    datasets: -> A list of the files and mongo DB we want to backup
    - files:
    patterns:
    - "/usr/local/afs7/conf"
    - "/usr/local/afs7/logs/"
    - "/usr/local/afs7/bo-server/conf/"
    - "/usr/local/afs7/bo-server/classify"
    - "/usr/local/afs7/bo-server/data/"
    - "/usr/local/afs7/bo-server/logs"
    - "/usr/local/afs7/bo-server/vocabularies/"
    - "/usr/local/afs7/bo-ac/acc"
    - "/usr/local/afs7/bo-ac/config/"
    - "/usr/local/afs7/bo-ac/core/"
    - "/usr/local/afs7/bo-ac/metrics/"
    - "/usr/local/afs7/bo-ac/promote/"
    - "/usr/local/afs7/bo-ac/stats/"
    - mongo:
    db_patterns:
    - antidot-backoffice

    excluded_collections:
    - magellan.component
    - magellan.host
    - magellan.meta
    - status
    - mongo:
    backs up all collections of the audit DB
    db_patterns:
    - antidot-audit
    - name: nerada
    datasets:
    - mongo:
    db_patterns:
    - antidot-nerada-.*

  2. Add the hosts to backup/restore in the my-hosts-config.yml file:

    defaults:
    backup_dir: /usr/local/afs7/backup
    backup_format: tgz
    tmp_dir: /tmp
    ssh:
    user: antidot
    key: /home/antidot/.ssh/default_ssh_key_file
    hosts:
    - hostname: my_bo.antidot.net
    roles:
    - bo
    - um
    bo:
    user: antidot
    password: secret_password
    - hostname: my_nerada.antidot.net
    roles:
    - nerada

  3. Run the following command:

    As root user

    afs_backup_tool --action backup --action restore --data-config data-config.yml --hosts-config my-hosts-config.yml

Only the bo and nerada database are backed up and restored, as defined in the my-data-config.yml and my-hosts-config.yml files. Data are backed up in the default backup directory defined in the my-hosts-config.yml file. And data are restored in the same place from where they were read as no dst_host was defined.