title: Recover PostgreSql database 9.1 with Mac
body: <p>I work with PostgreSql and PgAdmin, and I have had an accident that drives to format my Mac, here I have two options, recover all system via TimeMahine or install all from zero.</p>
  
  <p>I have chosen install from zero, but I need to recover the old PostgreSql database, now I’m installing all again, pgAdmin… etc, but I don’t have any backup of my old database, I have  the old PostgreSql database system files (thanks to TimeMachine), </p>
  
  <p>How can I recover the old database to the new one?</p>
  
  <p>I tried to do this, from <a href="http://www.postgresql.org/docs/8.1/static/backup-file.html" rel="nofollow noreferrer">http://www.postgresql.org/docs/8.1/static/backup-file.html</a></p>
  
  <pre><code>tar -cf backup.tar /usr/local/pgsql/data
  </code></pre>
  
  <p>the problem is that the data files are (I think) in <code>/Library/PostgreSQL/9.1/data</code> and the folder is encrypted or hidden ¿?</p>
  
  <p><img src="https://i.stack.imgur.com/XSCP3.png" alt="enter image description here"></p>
  
  <p>and I can't execute <code>tar</code> command this is what happens:</p>
  
  <pre><code> tar -cf backup.tar "/Volumes/backup/Backups.backupdb/MacBook, MacBook Pro de Albert/2014-04-30-112220/Macintosh HD/Library/PostgreSQL/9.1/data"
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>tar: /Volumes/backup/Backups.backupdb/MacBook, MacBook Pro de Albert/2014-04-30-112220/Macintosh HD/Library/PostgreSQL/9.1/data: Cannot stat: No such file or directory
  tar: Error exit delayed from previous errors.
  </code></pre>