I stumbled across this article last week:
And while he was dealing with a pre-release Lion, his symptoms are similar.
Check your /var directory for these recover folders:
I was able to stop postgres, rename the existing /var/pgsql folder, and then rename the most recent 'pre-restore' folder to pgsql and restart postgres and everything was there.
Why this is happenging - seems like postgres is not being shut down gracefully and this is how it deals with it.
More importantly for me, is how to recover data from these old directories - to merge all the content that has been lost to them.
We bought a new Mac mini server running Lion server, specifically for the Wiki purpose. We migrated from 10.5.8 Leopard server wiki, everything went fine, people were able to add new wiki pages and all that. However, after a reboot, the wiki DISAPPEARED!!!
We repeated the process twice, and the wiki disappeared after reboot. Basically we lost 2 days' work, and for a research lab like our size, this is very costly. I called up Apple enterprise support, and they contacted their Engineering team and told me that they are aware of this issue, but they could not fix it at the moment. I will have to wait until an update from Apple to fix this serious problem (at least for us). Before then, I am advised to keep using the Leopard server but not the Lion server.
I am shocked to learn all of these, as we have been using Apple products for years, and this is a very pleasant experience. Now my colleagues started worrying about their data security and the reliability of the Lion server.
This is my first post in the Apple forum, and I hope this is helpful for you guys.
Yes I am running 10.7.2, in fact we just got this server a few days ago. I am not sure about SuperDuper, could you elaborate a bit?
We are also running Time Machine. But I am not sure which folder we should restore. In the 10.5 and 10.6, there is a folder /Library/Collaborations which contains all the wiki files, but no longer exists in 10.7 server. Could you pelase also educate me on this too?
In any cases, I feel bad if I need to recover the wiki like this..
Well, that is a major bummer that they know about it, I was hopeful it was fixed in 10.7.2.
Super-Duper is a superb back-up utility that takes a complete snapshot of the drive at intervals you set. Perhaps for now, you can set it at every night, or run it before a reboot. If the data is gone, you can easily restore the entire drive, quickly.
So, to get you up and running, download a widget from apple's site that allows you to see hidden folders. It makes it easy to toggle hidden folders on and off. Just search "apple hidden file widget" and follow the link. The company / author is "Matt Hansen" and it is free.
Then, install the widget and activate it so you can see the hidden folders. You will now see the /var directory that Brian mentions above. While in that folder, you could replace out particular folders or files with the time machine copies. Maybe replace out all of the pgsql folders? I am not totally sure on that, but that is what I would do.
Giant caveat - I would run Super Duper beforehand, so that if you mess up some integral file, you can quickly and easily just make the drive like it was before you start restoring things.
When done, remember to go back to the widgets and turn off "show hidden file" so you cannot see them anymore.
Let us know what you end up doing so as to help others who may get hit with this. Also, as you may know, 10.7.3 is supposedly close to being released, so I have my fingers crossed that it will solve this issue.
Glad it worked for you. It happens to me all the time. I've lost count. If you're like me, before long you will be able to spot the key symptoms quickly, check /var and get everything renamed and restarted before you go down a path of creating new data. I've found that I get everything back.
It's insanity, because something is fundamentally broken with the Postgres implementation and I am ashamed at Apple over this. I regret having installed Lion Server, and I am repeatedly disappointed that it hasn't been fixed. How exactly is this acceptable? :-/
Best of luck to you!
One more thing. Whenever this happens, check your /etc directory too. I've found that 9 times out of 10, when there is a /var postgres "before-restore" folder, there is also an /etc/apache2.before-restore... folder and an /etc/certificates.before-restore... folder. The same remedy applies. You just have to stop apache and certificates services before moving the folders around.
# serveradmin stop certs
# serveradmin stop web
Shuffle folders, and then restart all the stopped services. Seems to work to recover without anything but the extra hassle.
The update to 10.7.3 (I think) does not really occur until after that startup. Or, perhaps if the wiki database setting was already corrupted or not stopped; the update would not address that until the next time you restart; again, just surmising that.
So, my plan is to now put in a few test entries and do some restarts (after hours) to see if I can recreate the issue. My hope is that 10.7.3 has fixed this problem; but alas, I did not see anything in the documentation that would state that.
However, 10.7.3 did fix a Xerox printing driver error we were getting that Xerox said was a fix Apple was working on. So, stuff got fixed that they might not mention, as it did with this printer issue we were having.
Anyway, I would recommend doing some testing on it with (test) entries and the like. I am not sure how else we can tell if it was fixed?