aldlfkahs / postgres-migration

Automate postgres(timescaledb) data migration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Postgres Migration

This shell script is for migrating(backup and restore) postgres data in kubernetes environment. 'tar' binary should be included in containers.

Step 0. Set up backup.config

  • Purpose : Set up backup.config for shell script
  • Order :
    • Set up configuration for your environment
      • backup_file_directory
        • The path of backup file
        • Only write the path except file-name omitting the last '/' character
        • ex) /home/swlee/postgres-backup
      • origin_ns
        • Namespace of postgres to backup
        • ex) my-backup
      • origin_label
        • Label array of postgres to backup
        • ex) ("app=postgres", "cluster=cluster1")
      • restore_ns
        • Namespace of postgres to restore
        • ex) my-restore
      • restore_label
        • Label array of postgres to restore
        • ex) ("app=postgres", "cluster=cluster2")

Step 1. Execute postgres-backup.sh

  • Purpose : Execute shell script
  • Pre-work
     sudo chmod +x postgres-backup.sh
  • Backup :
    ./postgres-backup.sh backup
  • Restore :
    ./postgres-backup.sh restore

About

Automate postgres(timescaledb) data migration


Languages

Language:Shell 100.0%