Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Promote Knowledge Base

Definitive answers from Promote experts.

How To: Backup your Promote PostgreSQL Database

JohnPo
Alteryx Alumni (Retired)
Created

How To: Backup the Promote PostgreSQL database

Promote uses a PostgreSQL database. This article explains how to create a backup of a Promoteinstance's database. Backing up your Promote database can save you time and headaches in the event of a system failure.

Prerequisites

  • Alteryx Promote≥ 2018.1

Procedure

  1. The PostgreSQL database must be backed up 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 backup process.

      1. On the host machinerunthe following bash command:

        docker exec -it $(docker ps | grep promote-db | awk '{print$1}') bash
      2. Run the backup script:

        sh /scripts/backups.sh
      3. Change to the directory of the database backup:

        cd /var/backups/postgres
      4. Copy the backup file to the host machine (the node that is hosting the promote-dbdocker container) from the database container (promote_app). This command needs to be run outside of the database container, changing /location/path to the database path on the host machine:

        docker cp $(docker ps | grep promote-db | awk '{print$1}'):/var/backups/postgres/{backup db name} /location/path 


    A backup of your database should now be saved in your specified directory. You deserve a coffee!

Comments
Nisreenaa
5 - Atom

Hello

 

Is this based on pure code ?

 

Regards

Nisreen