Restore a table to a different databse on the same server

963 views
Skip to first unread message

Ramon

unread,
Apr 1, 2015, 4:02:02 AM4/1/15
to pgba...@googlegroups.com
Hello everybody,

I am trying to figure out how to restore a table into a different database. Could somebody help me please?

I understand, that I have to use the commando "backup recover <server> ..."  But what kind options do I need to type.

Example :
- servername : example-database-server
- Source database #1 : db01 (20150401)
- Destination database #2 : db02
- Table : table1

I was thinking about the following command :
barman recover example-database-server 20150401 -table table1 -database db02

But i cannot find anything about this kind of way to restore a table.

What is the command to make this work?


Best regards,
Ramon Rottier.

Gabriele Bartolini

unread,
Apr 1, 2015, 4:13:54 AM4/1/15
to pgba...@googlegroups.com
Hi Ramon,

  Barman supports point in time recovery of a server. That is the minimal information unit you can restore. It does not support restore of a single database nor table.

  Your option is to restore the whole server (locally or remotely) then export your desired objects using pg_dump, then reimport them using psql/pg_restore, as you prefer.

Regards,
Gabriele

--
 Gabriele Bartolini - 2ndQuadrant Italia - Managing Director
 PostgreSQL Training, Services and Support
 gabriele....@2ndQuadrant.it | www.2ndQuadrant.it

--
--
You received this message because you are subscribed to the "Barman for PostgreSQL" group.
To post to this group, send email to pgba...@googlegroups.com
To unsubscribe from this group, send email to
pgbarman+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pgbarman?hl=en?hl=en-GB

---
You received this message because you are subscribed to the Google Groups "Barman, Backup and Recovery Manager for PostgreSQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pgbarman+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ramon

unread,
Apr 2, 2015, 4:54:33 AM4/2/15
to pgba...@googlegroups.com
Hello Gabriele,

You are speaking about "point in time recovery of server".
I do not understand.

Do you mean, when I use "barman recover" it will restore all the databases on that specific server? Or am I able to restore a specific database?
For example :
- servername : example-database-server
- Database #1 : db01
- Database #2 : db02

Could you give me the command of "barman recover" please?

I have figured out : barman recover <server> /var...

It is the part after "<server>" which I am not so sure of.
The idea is : That we want to do the following :
- Source : example-source-database-server
- Source : db01 (20150401), db03 (20150402)
- Destination : example-destination-database-server
- Destination : db04 (this is a restored database of db01)

Is something like possible?


On Wednesday, April 1, 2015 at 10:13:54 AM UTC+2, Gabriele Bartolini wrote:
Hi Ramon,

  Barman supports point in time recovery of a server. That is the minimal information unit you can restore. It does not support restore of a single database nor table.

  Your option is to restore the whole server (locally or remotely) then export your desired objects using pg_dump, then reimport them using psql/pg_restore, as you prefer.

Regards,
Gabriele
--
 Gabriele Bartolini - 2ndQuadrant Italia - Managing Director
 PostgreSQL Training, Services and Support
 gabriele.bartolini@2ndQuadrant.it | www.2ndQuadrant.it

mani...@gmail.com

unread,
Apr 9, 2015, 11:46:16 AM4/9/15
to pgba...@googlegroups.com
Hi,

You cannot restore a single database. Barman will restore the whole Postgresql server including all databases and users.
Barman is a solution for disaster recovery.

PITR allows you to to use a backup (for example 20150409T163320) then play the WAL files to recover your Postgresl instance into a given timestamp.

Regards,

Xavier C.
Reply all
Reply to author
Forward
0 new messages