Dealing with Orphaned Sites in a

makeshiftklipInternet και Εφαρμογές Web

31 Οκτ 2013 (πριν από 3 χρόνια και 9 μήνες)

87 εμφανίσεις

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

Introduction


Our Environment

Started out with WSS 2.0

Over 750 sites within the first year

Both an internal and an external environment

Current site count: Over 3200 sites and subsites within
our environment

Several very large custom web applications and portals,
each with custom webparts, solutions, and tools

About 2 TB of data



2

Introduction


Our Environment

Internal



3

Web
Front

Web
Front

Web
Front

App
Server

Index
Server

SQL

Introduction


Our Environment

External


4

SharePoint
Server

SQL

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

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

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” error

Error messages on the server

By running a SQL query

7

Orphaned Sites


Things Not To Do

Never,

ever
, under any circumstance, directly edit any of
your SharePoint databases.

Do not

manually update records

Do not

manually insert records

Do not

manually delete records

Don’t do it. Ever.

8

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/share
point
-
orphans
-
explained.aspx

Open Microsoft SQL Server Management Studio

Open up the query, and configure the variables for your
environment

Execute, and view the results

9

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 Database

Add the Configuration Database

You can use either Central Administration or Stsadm.exe

10

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 not

If they are, make a backup of each of them with the
STSADM

o
backup

command

Delete the sites with the
STSADM

o deletesite
command

Detach and re
-
attach the database

11

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

Orphaned Sites


Cleanin’ Em Up

The “Old School” Way (Cont.)


Restore all of the backed up sites using the
STSADM

o
restore

command

Run 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

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.aspx

To 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

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

Summary:

Use the old method if you don’t have SP2 installed

Make sure to use the “prepare to move” command before
removing databases if you don’t have the Infrastructure
Update installed

After 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

Questions? Comments?

e
-
mail: jason.meaden@pnl.gov

17