community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Promote Knowledge Base

Definitive answers from Promote experts.

How To: Restore a Promote PostgreSQL Database

Alteryx
Alteryx
Created on

How To: Restore a Promote PostgreSQL Database

 

This article outlines the process of restoring the Promote PostgreSQL database from a backup. For instructions on creating a backup, please see How To: Create a Promote PostgreSQL Database Backup.

 

Use these steps only if there is no data in your database. 

 

Only run these commands if:

  • Your PostgreSQL database is corrupted.
  • Your database is in a new state.

 

Prerequisites

 

  • Alteryx Promote ≥ 2018.2.1

 

Procedure

 

  1. The PostgreSQL database must be restored from the Master node, and not just the Leader node (note: these can be the same node). To return a list of node IDs, run the following command:

    docker node ls --format='{{.ID}}'
  2. To check if a node is the Master node, run the following command on each node ID from the list returned by the above command, replacing {node_id} with the node ID.

    docker node inspect {node_id} --format='{{.Spec.Labels.master}}' 
  3. Once you have determined the Master node (where "yes" is the returned response value from the above command), run the following commands from that node to start the PostgreSQL restoration process.

    1. Ensure the backed up PostgreSQL database is on your host machine. 
    2. Provide the Database Password with the following command:

      cat /var/promote/credentials/db.txt
    3. Copy the PostgreSQL database from the master node to the promote-db container on the same node, where /location/path is the location of the backed-up database:

      docker cp /location/path $(docker ps | grep promote-db | awk '{print$1}'):/var/backups/postgres
    4.  On the host machine run the following bash command:

      docker exec -it $(docker ps | grep promote-db | awk '{print$1}') bash
    5. Restore the database within the promote-db container:

      pg_restore -c -U ${POSTGRES_USER} -d ${POSTGRES_DB} -v "/var/promote/postgres/{database name}"


You should now be able to log into the UI and see your predictive models rebuild and go online. If not, please open a support ticket in the Case Portal.