Friday, August 10, 2007

Failure trying to synch web application

During a migration you sometimes delete a webapplication, create a new one.. attach the migrated content database and delete the webapplication again and so forth..
By doing this you suddenly get errors in the eventlog that looks like this :

Failure trying to synch web application 0ae4e145-5739-4d22-9a55-a05be465fb4e, ContentDB c7e4abe7-a670-4b7d-9350-c6105e4126ba  Exception message was A duplicate site ID 1680b2b0-e207-4aac-8dc2-72c9eb33812f(http://sitename) 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.

Fortunatly the problem solving was done using the first link that popped up in Google and that was the following : Gotcha When You Attach a New Web Application to an Old Content Database in SharePoint 2007 by Grant Earl.

Thanks Grant!

 

Technorati tags: , ,

4 comments:

Manju said...

Hello,
How can i change the MenuTemplateId of SPMenuField in an SPGRIDVIEW? Basically i need different MenuItems in each row. [Otherwise, disabling some MenuItems in some row would do.] i assumed that it could be possible with the following idea.


public void SPGriView1_OnRowCreated(object sender, GridViewRowEventArgs e)
{
SPMenuField spMenuField = (SPMenuField)e.Row.Cells[1].FindControl("spMenuField");
try
{
if (e.Row.DataItem != null)
{
//datatablePublications --> DataSource i.e. Datatable
DataRow drPublication = datatablePublications.Rows[e.Row.DataItemIndex];
string strStatus = drPublication["Locked"].ToString();
if (strStatus == "true")
spMenuField.MenuTemplateId = "PublicationLocked";
else if (strStatus == "false")
spMenuField.MenuTemplateId = "PublicationUnlocked";

}
}

catch { }

//spMenuField.MenuTemplateId = "PublicationUnlocked";
}

but it ended up with compilation error, saying that-cannot convert from "System.Web.UI.Control" to "Microsoft.SharePoint.WebControls.SPMenuField"


Is this a the way i can accomplish this.Or please let me know, if there is a better way of doing it.

Manju said...

Hello,
How can i change the MenuTemplateId of SPMenuField in an SPGRIDVIEW? Basically i need different MenuItems in each row. [Otherwise, disabling some MenuItems in some row would do.] i assumed that it could be possible with the following idea.


public void SPGriView1_OnRowCreated(object sender, GridViewRowEventArgs e)
{
SPMenuField spMenuField = (SPMenuField)e.Row.Cells[1].FindControl("spMenuField");
try
{
if (e.Row.DataItem != null)
{
//datatablePublications --> DataSource i.e. Datatable
DataRow drPublication = datatablePublications.Rows[e.Row.DataItemIndex];
string strStatus = drPublication["Locked"].ToString();
if (strStatus == "true")
spMenuField.MenuTemplateId = "PublicationLocked";
else if (strStatus == "false")
spMenuField.MenuTemplateId = "PublicationUnlocked";

}
}

catch { }

//spMenuField.MenuTemplateId = "PublicationUnlocked";
}

but it ended up with compilation error, saying that-cannot convert from "System.Web.UI.Control" to "Microsoft.SharePoint.WebControls.SPMenuField"


Is this a the way i can accomplish this.Or please let me know, if there is a better way of doing it.

dunxd said...

Now your post is at the top of Google, and the link you refer to goes nowhere. Beauty of the web - sites and blogs come and go, but the links last forever....

Now if only I can find the solution to the problem...

Robin Meuré said...

hi Dunxd,

you are right.. that's the problem of the internet eh? ;) But ho help you out.. The command to solve this problem is "STSADM -o sync deleteolddatabases 0" .. check http://technet.microsoft.com/en-us/library/cc263196.aspx for more info :)