17
You too can be one step closer to having a clean, pristine SharePoint environment! 1 Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment PNNL-SA-66367 Jason Meaden IT Engineer, PNNL Collaboration Tools and Services

Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

  • Upload
    ravi

  • View
    43

  • Download
    0

Embed Size (px)

DESCRIPTION

Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment. You too can be one step closer to having a clean, pristine SharePoint environment!. Jason Meaden IT Engineer, PNNL Collaboration Tools and Services. PNNL-SA-66367 . Introduction – Our Environment. - PowerPoint PPT Presentation

Citation preview

Page 1: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

You too can be one step closer to having a clean, pristine SharePoint environment!

1

Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

PNNL-SA-66367

Jason MeadenIT Engineer, PNNL Collaboration Tools and Services

Page 2: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Introduction – Our Environment

Started out with WSS 2.0Over 750 sites within the first yearBoth an internal and an external environmentCurrent site count: Over 3200 sites and subsites within our environmentSeveral very large custom web applications and portals, each with custom webparts, solutions, and toolsAbout 2 TB of data

2

Page 3: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Introduction – Our Environment

Internal

3

Web Front

Web Front

Web Front

App Server

Index Server SQL

Page 4: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Introduction – Our Environment

External

4

SharePoint Server

SQL

Page 5: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Orphaned Sites – What Are They?

Orphaned objects are sites and/or site collections that don’t have corresponding entries in the configuration database.The orphaned site collection data still exists, but the only way to access it is by detaching its content database from the current web application, and then attaching it to a different web application (one that doesn’t have a site collection registered at that URL path.)

5

Page 6: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Orphaned Sites – Where Do They Come From?

From Microsoft: “Site collections typically become orphaned when they are in a content database that is being attached to a Web application, but the Web application already contains a site collection with the same Uniform Resource Locator (URL) path. Because site collections cannot share the same URL path in a Web application, only the first site collection registered in the site map will be accessible. All other site collections that use the same URL path cannot be registered in the site map and are considered orphans.”

6

Page 7: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Orphaned Sites – How Can You Tell If You Have Them?

Signs to watch for:You run the STSADM –o deletesite command and it fails with the error “This site does not exist”You run the STSADM –o restore command and it fails with a “0x80040E2F” errorError messages on the serverBy running a SQL query

7

Page 8: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Orphaned Sites – Things Not To Do

Never, ever, under any circumstance, directly edit any of your SharePoint databases.Do not manually update recordsDo not manually insert recordsDo not manually delete recordsDon’t do it. Ever.

8

Page 9: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Orphaned Sites – Cleanin’ Em Up

The “Old School” Way (Painful.)Grab the SQL code from here: http://blogs.technet.com/corybu/archive/2007/05/31/sharepoint-orphans-explained.aspxOpen Microsoft SQL Server Management StudioOpen up the query, and configure the variables for your environmentExecute, and view the results

9

Page 10: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Orphaned Sites – Cleanin’ Em Up

The “Old School” Way (Painful.)

Use this method if you don’t have SP2 installed

Configuration Database Orphans (“Easy” Ones)Notify users (perform during an outage window)Remove Configuration DatabaseAdd the Configuration DatabaseYou can use either Central Administration or Stsadm.exe

10

Page 11: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Orphaned Sites – Cleanin’ Em Up

The “Old School” Way (Painful.)

Content Database Orphans (The Not Easy one.)Ensure that you have a complete and full backup of *everything*Notify users (again, outage window)Determine if the orphaned sites are accessible or notIf they are, make a backup of each of them with the STSADM –o backup commandDelete the sites with the STSADM –o deletesite commandDetach and re-attach the database

11

Page 12: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Orphaned Sites – Cleanin’ Em Up

The “Old School” Way (Cont.)

After re-attaching the database, attempt to find the site again If you find it, delete the site, and detach / re-attach the database.Repeat, until you can’t find the orphaned site any more.

12

Page 13: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Orphaned Sites – Cleanin’ Em Up

The “Old School” Way (Cont.)

Restore all of the backed up sites using the STSADM –o restore commandRun the FindOrphans SQL query again – cross your fingers that all of the orphaned sites are gone

If they are? You’re done!If they aren’t, time to start from the beginning.

13

Page 14: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Orphaned Sites – Cleanin’ Em Up

The “New School” Way (Slightly less painful. Hopefully.)

Use this method if you’ve installed SP2

http://technet.microsoft.com/en-us/library/cc261873.aspxTo delete an orphaned site collection named "http://server_name/sites/site_name", perform the following steps:Use the STSADM –o enumallwebs operation to find the site whose URL matches "/sites/site_name“, and look for the inSiteMap attribute among the information returned

14

Page 15: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Orphaned Sites – Cleanin’ Em Up

The “New School” Way

Look for sites with an InSiteMap attribute that has a value equal to “False.” This means the site is orphaned. Use the value of the Id attribute from the matching Site tag and use it as the value of the siteid parameter of the deletesite operation.For example: stsadm -o deletesite -force -siteid e2a114b8-80c9-41f6-87bf-3feddf2ad9b6 -databaseserver DS1 -databasename DB1 Perform this for each orphaned site

15

Page 16: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Summary:

Use the old method if you don’t have SP2 installedMake sure to use the “prepare to move” command before removing databases if you don’t have the Infrastructure Update installedAfter you’ve installed SP2, use the new method.

Orphaned sites will happen to everyone – but with a bit of patience and knowledge they can be taken care

of without too much difficulty!

16

Page 17: Methods and Solutions for Dealing with Orphaned Sites in a Large Scale SharePoint Environment

Questions? Comments?

e-mail: [email protected]

17