How to backup the database

Learn how to back up the database in the UMH stack using TimescaleDB. This tutorial is for non-local installations and covers the requirements and instructions for performing a backup, including installing pg_dump, finding the IP or DNS of your server, and executing the command for backup. Ensure your data can be recovered in case of catastrophic failure by following the steps outlined in this tutorial.

When performing major upgrades, and in accordance with your company’s backup strategy, you should back up the database.

This ensures that your data can be recovered in the event of a catastrophic failure.

This tutorial was created for non-local installations.

Requirements

pg_dump is usually bundled with a PostgreSQL installation. For Windows, it can be installed with Chocolatey or the EnterpriseDB installer.

For other platforms, please look up how to install PostgreSQL using your package manager.

We have observed that production databases store approximately 100 GB of data per year.

You need to have at least this amount of disk storage to perform a backup.

Instructions

  1. Find the IP address or DNS name of your server.

  2. Open http://YOUR_IP:5432/ (e.g. http://192.168.178.44:5432/) in a browser to check if Timescale is exposed on your server (it is by default).

  3. If the site displays the error message “ERR_EMPTY_RESPONSE”, Timescale is exposed and you can proceed.0

    raw.png

  4. If the site displays an error such as “ERR_TIMEOUT”, your timescale DB is not accessible.

  5. Open a shell and navigate to the folder where pg_dump is installed. On Windows, this is C:\Program Files\PostgreSQL\15\bin.

  6. Execute the following command, changing the YOUR_IP section, and the output folder:

    1. .\pg_dump.exe -h YOUR_IP -p 5432 -U factoryinsight -Fc -f X:\umh_2020-09-01.back postgres

      raw (1).png

Last modified February 17, 2023: update (#208) (ea731fc)