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

Old Backup Server To New Backup Server #2299

Closed
moindba opened this issue Mar 11, 2024 · 3 comments
Closed

Old Backup Server To New Backup Server #2299

moindba opened this issue Mar 11, 2024 · 3 comments
Assignees
Labels

Comments

@moindba
Copy link

moindba commented Mar 11, 2024

Please provide the following information when submitting an issue (feature requests or general comments can skip this):

  1. pgBackRest version: 2.39

  2. PostgreSQL version: 12.15

  3. Operating system/version - if you have more than one server (for example, a database server, a repository host server, one or more standbys), please specify each:

Ubuntu 20

  1. Did you install pgBackRest from source or from a package?
    Source Code

  2. Please attach the following as applicable:

    • pgbackrest.conf file(s)
    • postgresql.conf settings applicable to pgBackRest (archive_command, archive_mode, listen_addresses, max_wal_senders, wal_level, port)
    • errors in the postgresql log file before or during the time you experienced the issue
    • log file in /var/log/pgbackrest for the commands run (e.g. /var/log/pgbackrest/mystanza_backup.log)

Archive Command:

archive_command: pgbackrest --stanza=prod archive-push %p

DB Server Configuration

[global]
repo1-host=xx.xxx.xxx.xx
repo1-host-user=pgbackrest
spool-path=/var/spool/pgbackrest
compress-level=6
compress-type=gz

[global:restore]
process-max=8

[global:archive-get]
process-max=4

[prod]
pg1-path=/postgresql/main

========================================================
New Backup Server Configuration:

[global]
repo1-path=/backup/pgbackrest
repo1-retention-archive=4
repo1-retention-full=4
repo1-retention-diff=4
start-fast=y
backup-standby=y
spool-path=/var/spool/pgbackrest
log-level-file=detail
log-level-console=detail
compress-type=gz
compress-level=6

[global:backup]
process-max=8

[global:restore]
process-max=16

[global:archive-get]
process-max=16

[global:archive-push]
process-max=2

[prod]
pg1-host=xx.xxx.x.xx
pg1-path=/postgresql/main
pg2-host=xx.xx.x.xx
pg2-path=/postgresql/main
pg3-host=xx.xxx.x.xx
pg3-path=/postgresql/main

  1. Describe the issue:
    We need to change Current Backup Server to New Backup Server, as per Infra Team suggestions.

For the above requirement i am following below steps

  1. Install same version of pgBackrest on new backup server.
  2. setup ssh authentication between new pgbackrest backup server and DB Server.
  3. configure pgbackrest.conf on new backup server and change the repo1-host IP on DB Server
  4. create stanza with same name, which we are currently using on old backup server.

we dont want to change the archive_command and stanza name.

Old backup Server DB Backups will not be move or copy to new backup server, so it will be a fresh New Backup Server.

are the above steps are good to go for the change ?

@pgstef
Copy link
Member

pgstef commented Mar 11, 2024

Hi,

are the above steps are good to go for the change ?

If you don't want to copy/move the old repo content to the new one, yes, those steps seems enough to me.
stranza-create can safely be used to init a new repo. And changing the repo1-host IP will make pgBackRest send the WAL archives there.

Kind Regards

@pgstef pgstef self-assigned this Mar 11, 2024
@moindba
Copy link
Author

moindba commented Mar 11, 2024

Thanks stepfan,

Whats steps i need to follow i want to move/copy old repo content to new repo ?

How can i make sure that wal archive should not be move to old backup server ?

is it safe to make stanza-create with same repo name as old repo name, as we dont want to change the archive_command and stanza name.

@wajid-saleem2
Copy link

update repo1-host IP to new backup server, then initialize a new stanza with the same name as old repo. Ensure old repo is decommissioned to prevent WAL archives from being sent there.

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

No branches or pull requests

4 participants