Files
pg-bkup/docs/how-tos/restore.md
2024-08-03 00:49:14 +02:00

1.0 KiB

title, layout, parent, nav_order
title layout parent nav_order
Restore database default How Tos 4

Restore database

To restore the database, you need to add restore subcommand to pg-bkup or bkup and specify the file to restore by adding --file store_20231219_022941.sql.gz.

{: .note } It supports .sql and .sql.gz compressed file.

Restore

services:
  pg-bkup:
    # In production, it is advised to lock your image tag to a proper
    # release version instead of using `latest`.
    # Check https://github.com/jkaninda/pg-bkup/releases
    # for a list of available releases.
    image: jkaninda/pg-bkup
    container_name: pg-bkup
    command:
      - /bin/sh
      - -c
      - pg-bkup restore -d database -f store_20231219_022941.sql.gz
    volumes:
      - ./backup:/backup
    environment:
      - DB_PORT=5432
      - DB_HOST=postgres
      - DB_NAME=database
      - DB_USERNAME=username
      - DB_PASSWORD=password
    # pg-bkup container must be connected to the same network with your database
    networks:
      - web
networks:
  web: