0

I have copied database folder from data/base and I wanted to copy them in another computer but in pgAdmin can't find the new database should I do something else besides copying the folder in data/base?

I'm using PostgreSQL 9.3

enter image description here The problem is that when I try to save database from pgAdmin it freezes, I'm not sure if the database is corrupted or some tables.

SlimenTN
  • 3,383
  • 7
  • 31
  • 78
  • `data/base` is not enough to restore a complete cluster. You have to copy the complete `data` but that will **only** work if the you copied the data while Postgres was stopped, the target computer uses the same operating system and the exact same Postgres version. –  Sep 13 '18 at 10:21
  • Have you considered using pg_dump? – Royal Wares Sep 13 '18 at 10:21
  • @AlexanderDeSousa how can I use it ? – SlimenTN Sep 13 '18 at 10:22
  • http://www.postgresqltutorial.com/postgresql-backup-database/ – Royal Wares Sep 13 '18 at 10:24
  • @AlexanderDeSousa The problem is that when I try to save database from pgAdmin it freezes, I'm not sure if the database is corrupted or some tables. taht's why I decided to copy the whole folder of database – SlimenTN Sep 13 '18 at 10:27
  • @a_horse_with_no_name not sure this was actually a duplicate, as the original question was about copying a database via the file structure which none of those articles do. – Royal Wares Sep 13 '18 at 10:27
  • @AlexanderDeSousa: the last duplicate (https://stackoverflow.com/questions/22503185/is-it-possible-to-restore-a-postgres-database-by-simply-swapping-out-some-files) covers that. But given the fact that SlimenTN just wants to backup some tables, the list of duplicates will answer that. –  Sep 13 '18 at 10:28
  • @a_horse_with_no_name I don't think I spotted your edit in time, yep sounds good on that last link. :) – Royal Wares Sep 13 '18 at 10:29

0 Answers0