Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Time Machine Restore - Empty Postgres Databases

Hello,


i just had to restore Lion Server and have a problem with it now. All files are back, but my the databases are completely empty.

I have a dumpall.psql file, but i dont see how to get it back into the postgres database. I know how to deal with mysql, but this seems completely different to it.

I also have PgAdmin installed and can connect to the database.


Can someone point me the right way please?


Another Problem i have is, that the server seems to forget my password. Everytime i try to login with my main user, the password field shakes. I am a 100 % sure it is the right password. I can only login with a second admin account. When i do a restore from an Open Directory Backup in Server Admin it seems to work again for a while, but not for long.



Please help me, i really need the server back to work.

Mac mini, Mac OS X (10.7.4), Lion Serer

Posted on May 31, 2012 10:05 AM

Reply
5 replies

Jun 1, 2012 3:12 AM in response to volderette

Ok, i'm at least some steps closer:

I have my data back in postgre and all users have their data back on their devices. At least their data up to the last backup.

Here is what i did:


  1. I restored another time machine backup.
  2. Apple claims, that serverbackup (and therefore Time Machine) does backups of the postgre data, which is true.
  3. Apple claims, that the postgre data will be restored in case of a Time Machine restore. In my case it didnt.
  4. You find a dumpall.psql in your time machine backups --> Library/Server/PostgreSQL/Backup (In my case there was a gzip file as well, but it didnt seem to be updated)
  5. I connected with postgre using pgadmin 3 following this tutorial: http://www.mactasia.co.uk/revisited-using-postgresql-in-lion-server
  6. I dropped all databases but the postgres-database.
  7. Open Terminal and write "sudo psql -f infile postgres" with infile being the path to your dumpall.psql (More commands at http://www.postgresql.org/docs/8.1/interactive/backup.html)
  8. This will write all data from the backup to your database.
  9. Voilá, you will have your data back.
  10. Give the clients time to get the content back from the server.
  11. Never start the wiki again, because it was the one which destroyed everything in the first place.


Still i have a huge problem:


I cant login with my main admin user. I can login with another admin. Then i reset the main user password and i can login with it again. But only once. Any advice on this?

Time Machine Restore - Empty Postgres Databases

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.