Last week, while our portal site had no problem, the MOSS 2007 server's event log was full of the error below:
"Failure trying to synch web application ..., ContentDB ... Exception message was A duplicate site ID ... (http://...) was found. This might be caused by restoring a content database from one server farm into a different server farm without first removing the original database and then running stsadm -o preparetomove. If this is the cause, the stsadm -o preparetomove command can be used with the -OldContentDB command line option to resolve this issue."
This error occurs when detaching and attaching a content database or using an old content database with a new web application. The solution to this problem is the command below:
stsadm -o sync -deleteolddatabases