Restore the Data Repository

You can restore Data Repository from an existing backup. To restore Data Repository, ensure that the database administrator user is part of the sudoers file.
You can restore the data repository from an existing backup. To restore Data Repository, ensure that the database administrator user is part of the sudoers file.
Do not restore a backup of an older release into a newer environment. The data from the older version might not be fully compatible with schema changes.
Usually, you restore the data repository to the same computer where you backed it up from. However, you
can
restore the data repository to a different computer. The computer to which you restore must be configured in the same way that the computer you backed up the data repository from is configured. In a cluster environment, each computer to which you restore must be configured in the same way that each computer you backed up each data repository node from is configured.
The following configurations must be the same:
  • the IP address
  • the hostname
  • the catalog and data directories
  • the catalog and data directory permissions
  • the Vertica Linux database administrator user credentials
  • the database administrator user account credentials
  • the database user account credentials
Follow these steps:
  1. Stop the data collector hosts that are associated with the data aggregator by logging in to the computers where the data collector is installed as the root user or a sudo user with access to a limited set of commands. Open a command prompt, and then issue
    one
    of the following commands:
    • service dcmd stop
    • sudo service dcmd stop
    For RHEL 7.x or OL,
    service
    invokes
    systemctl
    . You can use
    systemctl
    instead.
    The data collector hosts stop.
  2. Stop the data aggregator by logging in to the computer where the data aggregator is installed as the root user or a sudo user with access to a limited set of commands. Do one of the following steps:
    • Stop the Data Aggregator service by issuing the following command:
      service dadaemon stop
      The data aggregator starts.
    • (Fault tolerant environment) If the local data aggregator is running, put the data aggregator in maintenance mode by issuing the following command based on your installation:
      • RHEL 6.x:
        service dadaemon maintenance
      • RHEL 7.x, SLES, or OL:
        DA_Install_Directory/scripts/dadaemon maintenance
      The data aggregator becomes inactive and unavailable for failover.
    The data aggregator stops.
  3. Log in to the database server you use for the data repository as the database administrator user,
    not
    as the root user.
  4. Issue the following command:
    /opt/vertica/bin/adminTools
    The
    Administration Tools
    dialog opens.
  5. Select
    (4) Stop Database
    .
  6. Press the
    Space
    bar next to the database name, select
    OK
    , and then press the
    Enter
    key on your keyboard.
    You are prompted for the database password.
  7. Enter the database password, and then press the
    Enter
    key on your keyboard.
    The data repository stops.
    If the data repository does not stop, select
    (2) Stop Vertica
    on Host from the
    (7) Advanced Tools Menu
    .
  8. Select
    Exit
    , and then press the
    Enter
    key on your keyboard.
  9. To prepare to restore the data repository backup, log in as the Linux user account for the database administrator user to the database server you use for the data repository.
    When you set up automatic backups of the data repository, you configured the configuration file with a restore point of seven. You can restore the data repository to the most recent backup or to any of the previous seven incremental backups.
  10. Do
    one
    of the following steps:
    • To restore the data repository to the most recent backup, issue the following command:
      /opt/vertica/bin/vbr.py --task restore --config-file
      <configuration_directory_path_filename>
      • configuration_directory_path_filename
        Indicates the filename and directory path of the configuration file you created when you ran the backup configuration procedure. This file is located where you ran the backup utility (/opt/vertica/bin/vbr.py).
      For example:
      /opt/vertica/bin/vbr.py --task restore --config-file /home/vertica/vert-db-production.ini
      In a cluster installation, you can run the restore task from any of the hosts that are participating in the cluster.
      For a list of available restore points, issue the following command:
      /opt/vertica/bin/vbr.py --task listbackup --config-file
      <configuration_directory_path_filename>
    • To restore the data repository to any of the previous seven incremental backups, issue the following command:
      /opt/vertica/bin/vbr.py --task restore --config-file
      <configuration_directory_path_filename>
      --archive <
      archive_name>
      For example:
      /opt/vertica/bin/vbr.py --task restore --config-file myconfig.ini --archive 20131020_170018
      • configuration_directory_path_filename
        Indicates the filename and directory path of the specific configuration file you want to restore a specific archive from. You created this configuration file when you ran the backup configuration procedure. This file is located where you ran the backup utility (/opt/vertica/bin/vbr.py).
      • archive_name
        Indicates the name of the specific restore point that you want to restore to. Change to the backup directory that the configuration file for the restore point indicates. All of the restore points that are available are listed. Determine the archive name for the restore point that you want to restore to.
      In a cluster installation, you can run the restore task from any of the hosts that are participating in the cluster.
      For a list of available restore points, issue the following command:
      /opt/vertica/bin/vbr.py --task listbackup --config-file configuration_directory_path_filename
  11. Restart the data repository by logging in to the computer where the data repository is installed as the database administrator user,
    not
    as the root user. Open a command prompt and do the following steps:
    1. Issue the following command:
      /opt/vertica/bin/adminTools
      The
      Administration Tools
      dialog opens.
    2. Select
      (3) Start Database
      .
    3. Press the
      Space
      bar next to the database name, select
      OK
      , and then press the
      Enter
      key on your keyboard.
      You are prompted for the database password.
    4. Enter the database password, and then press the
      Enter
      key on your keyboard.
      The data repository starts.
    5. Select
      Exit
      , and then press the
      Enter
      key on your keyboard.
  12. Restart the data aggregator. Log in to the data aggregator host as the root user or a sudo user, and start the dadaemon service. Do
    one
    of the following steps:
    • Start the Data Aggregator service:
      service dadaemon start
      The data aggregator starts.
    • (Fault-tolerant environment) If the local data aggregator is running, put the data aggregator in maintenance mode by issuing the following command based on your installation:
      • RHEL 6.x:
        service dadaemon maintenance
      • RHEL 7.x, SLES, or OL:
        <DA_Install_Directory>
        /scripts/dadaemon maintenance
      The data aggregator becomes inactive and unavailable for failover.
  13. Restart the data collectors. Log in to each data collector host as the root user or a sudo user, and start the Data Collector service by issuing
    one
    of the following commands:
    • service dcmd start
    • sudo service dcmd start
    The data collectors restarts.