pg_probackup icon indicating copy to clipboard operation
pg_probackup copied to clipboard

pg_probackup restore to local path

Open glafir opened this issue 3 years ago • 10 comments

Make pg_probackup restore from mounted store to local path without agent?

For example

/mnr/backups - mount store with backups /path - somthing empty path wanting to restore

I tried it pg_probackup-11 restore -B /mnt/backups/ --instance some_inst -D /path But I get this error ERROR: Agent error: Permission denied If "some_inst" is not avaliable? I want to restore without ssh agent.

glafir avatar Mar 30 '21 20:03 glafir

Mmmm. I understand. Those backups has config here /mnt/backups/backups/some_inst/pg_probackup.conf This config has

...
# Remote access parameters
remote-proto = ssh
remote-host = some_host
remote-user = postgres

How to ignore this config if I do not to remove it?

glafir avatar Mar 30 '21 21:03 glafir

Yes!!! I commented strings (see above comment). This works!!!

glafir avatar Mar 30 '21 21:03 glafir

Hello! It is a consequence of an old bug, fixed in 2.3.0 version:

The add-instance command no longer implicitly sets the --remote-proto and --remote-host parameters in the instance configuration when adding a remote PostgreSQL instance into the backup catalog.

At this point only old installations are affected by it.

Yes!!! I commented strings (see above comment). This works!!!

The recommended way would be to use set-config command to unset this parameter:

pg_probackup set-config --instance some_inst --remote-host=none

... or overwrite it on command line, when running restore:

pg_probackup restore ... --remote-host=none

Sorry for taking so long with response.

gsmolk avatar Mar 30 '21 22:03 gsmolk

ERROR: Agent error: ssh: Could not resolve hostname none: Name or service not known

glafir avatar Mar 31 '21 07:03 glafir

I ser --remote-proto none without --remote-host=none

This is work for me!!! Its gooooood! Thanks!

glafir avatar Mar 31 '21 07:03 glafir

ERROR: Agent error: ssh: Could not resolve hostname none: Name or service not known

wow, looks like a bug to me

gsmolk avatar Mar 31 '21 08:03 gsmolk

most likely this is due to the specified setting in the config

# Remote access parameters
**remote-proto = ssh**
remote-host = some_host
remote-user = postgres

If you set --remote-host none, but --remote-proto remain as ssh (because it set in config)

glafir avatar Mar 31 '21 09:03 glafir

mmm. From console --help

      --remote-proto=protocol      remote protocol to use
                                   available options: 'ssh', 'none' (**default: ssh**)

glafir avatar Mar 31 '21 10:03 glafir

none should be treated as a special value for remote-host, and a range of allowed values for remote-proto should be limited to ssh and none. None of this conditions are enforced right now, which is baaad

gsmolk avatar Mar 31 '21 15:03 gsmolk

Will be fixed in 2.4.15

gsmolk avatar Apr 12 '21 12:04 gsmolk