Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is this remotely possible?

I am trying to correct some orphaned entries (specifically webparts) in the content database's AllWebparts table (they have PageUrlIDs but no corresponding entries in the AllDocs table) and am wondering if there is a supported method of creating a file/webpart page so that it has a specific ID.

If I can, then hopefully either the error will go away and the pages stay there forever, or the webparts exist in the maintentance page and I can delete them, then the pages and forget this ever happened.

Edit Im going to take a wild guess and say no, since that would open up SharePoint for a whole mess of issues if people could decide on the unique identifiers. But, I am getting pretty desperate for a solution at this point.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Sorry, you can't force specific ID for an item. Neither list specific integer ID, nor the UniqueId (GUID).

You should be able to remove the orphans using SPContentDatabase.Repair (source, source).

$db = Get-SPDatabase "Content_DB_Name";
#note set this to $true if you want it to actually repair the database. $false will just list what it would repair
$db.Repair($false);
$db.Update(); #never hurts
share|improve this answer
    
Ill give that a shot right now. If it works I am going to kick myself in the ass. –  John S Feb 27 '13 at 21:58
    
Unfortunately that didnt work. And after checking the msdn entry, it only looks for lists, spsite and spweb objects. –  John S Feb 27 '13 at 22:10
    
Too bad it didn't help :( MSDN article says it should also affect documents: "...to delete corrupted site collections, Web sites, lists, and documents..." –  Jussi Palo Feb 28 '13 at 11:23
    
While it will, I need it to remove orphaned webparts. –  John S Mar 5 '13 at 16:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.