Redash tasks#

Create a Redash server#

  1. Configure PostgreSQL and Docker apps in the server’s Pillar file

  2. Create the new server

  3. Configure an external firewall, opening SSH, ICMP, HTTP and HTTPS.

Note

Our Docker Compose file is based on the official setup repository, with these changes:

  • Use Apache for SSL termination

  • Update the PostgreSQL version and run it on the host

  • Update the Redis version and add a health check

  • Update the Redash version

Dump the old server’s database#

  1. SSH into the old server as the root user.

  2. Create the database dump. (If PostgreSQL is running in Docker, you might need to expose its ports first.) For example:

    pg_dump -h localhost -U postgres -f redash.sql postgres
    
  3. Change the database user to redash, if necessary. For example:

    sed -i 's/OWNER TO postgres/OWNER TO redash/g' redash.sql
    
  4. Disconnect from the old server:

    exit
    
  5. Copy the database dump to your local machine. For example:

    rsync -avz root@ocp08.open-contracting.org:~/redash.sql .
    
  6. Copy the database dump to the new server. For example:

    rsync -avz redash.sql root@ocp14.open-contracting.org:~/
    

Load the new server’s database#

  1. SSH into the new server as the root user.

  2. Load the database dump into the redash database:

    sudo -i -u postgres psql -f redash.sql redash
    
  3. Change to the non-root user and Redash directory:

    su - deployer
    cd /data/deploy/redash
    
  4. Start the containers:

    docker-compose up -d

Upgrade the Redash service#

  1. Update the image in the Docker Compose file to the latest tag. Read the release notes for any other updates to make.

  2. Deploy the service.

  3. SSH into redash.open-contracting.org as the root user.

  4. Change to the non-root user and Redash directory:

    su - deployer
    cd /data/deploy/redash
    
  5. Pull the images:

    docker-compose pull
    
  6. Stop the Redash containers:

    docker-compose stop server scheduler scheduled_worker adhoc_worker worker
    
  7. Run database migrations, if required:

    docker-compose run --rm server manage db upgrade
    
  8. Start the Redash containers:

    docker-compose up -d
    
  9. Check that the new version is running by viewing the System Status page and reading the Version. You may need to log in to Redash to access this page.