Tuesday, September 29, 2009

The site collection could not be restored.

I ran into an issue the other night doing some reorganising of site collections in a production wss 3.0 instance. I was moving sites from one web application to another using backup and restore (mergecontentdb's only works in the one webapp).


On one particular site when running stsadm -o restore I received
"The site collection could not be restored. If this problem persists, please make sure the content databases are available and have sufficient free space"
Based on the error message I did the usual checks and discovered there was no issue with free space.

Then I looked at the site collections listing page which gave me a clue.The site I was trying to restore was already listed there but when I tried to load it the site didn't work. I've seen similar behaviour when a previous restore has stopped part way through.
To resolve I did the following:
  • Detach and Reattach each of the content db's , this removed the site collection listing from CA but the error still occurred
  • I then ran stsadm -o databaserepair against the database's and it removed a bunch of orphaned records.

After that I was then able to restore the site without issue. So it looks like that error message can mean a previous partial restore of the site exists in the content databases already and needs to be cleared.