Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the correct way to restore logical backups? #2878

Closed
SergeiCherevko opened this issue Mar 12, 2025 · 0 comments
Closed

What is the correct way to restore logical backups? #2878

SergeiCherevko opened this issue Mar 12, 2025 · 0 comments

Comments

@SergeiCherevko
Copy link

I use the Postgres Operator to create a PostgreSQL database for Grafana:

apiVersion: "acid.zalan.do/v1"
kind: postgresql
metadata:
  name: grafana-playground-postgres
spec:
  resources:
    limits:
      cpu: "1"
      memory: 4Gi
    requests:
      cpu: "1"
      memory: 4Gi
  teamId: grafana
  numberOfInstances: 2
  postgresql:
    version: "14"
    parameters:
      max_connections: "1000"
  volume:
    size: 10Gi
  users:
    grafana:
      - login
  databases:
    grafana: grafana

This setup creates a primary (master) and a replica.

Now, I want to take a logical backup from the production Grafana PostgreSQL and restore it on this playground cluster.

I couldn't find any manuals explaining how to do this, but I assume the steps would be:

  • Stop Grafana pods to prevent connections to the primary PostgreSQL pod.
  • Drop the Grafana database.
  • Upload the logical PostgreSQL dump to the primary PostgreSQL pod.
  • Restore the dump using:
psql -f /tmp/grafana_prod_pg_dump.sql
  • Handle Patroni and the replica pod. (???)

Are these the correct steps? How can I ensure that the replica is properly synchronized with the new database after dropping it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant