Anonymous
Anonymous

Reputation: 4757

How to restore PostgreSQL database backup without psql and pg_restore?

I am using postgresql on an embedded device running yocto (customized linux). The package containing postgresql does not provide psql or pg_restore. /usr/bin provides the following tools:

enter image description here

pg_basebackup indicates that I am able to create backups. But how am I supposed to restore a backup within a terminal? With pg_restore or psql this would not be a problem for me.

Please note: I want to use a backup created on my windows/linux computer to create the initial database on the embedded device.

Upvotes: 0

Views: 2101

Answers (1)

Gautam Kumar
Gautam Kumar

Reputation: 575

Create backup of the db using command:

pg_basebackup -h {host_ip} -D pg_backup  -U {USER}

for restoring just change the data folder to pg_backup. Now start the psql server.

Upvotes: 1

Related Questions