Restoring a SharePoint Site Collection to a new domain

One would think that SharePoint would prevent you from loading up a SharePoint backup on a new domain with conflicting SIDs and usernames, but it actually allows you to do so without too much grief. I recently had to do this for a client who was having serious problems with WSS search and after a few trials and tribulations with STSADM I was able to get it up and running on my test virtual machine in a matter of minutes. Obviously my test VM isn’t on the client’s domain nor does it share and SIDs with the original hosting environment.

Disclaimer!!!  The notes below are just that: notes that I compiled while working on a client’s MOSS SP1 environment.  This is obviously an invasive procedure so do your due diligence and take backups, use test machines, and be careful!

Here’s how I did it

Source Server

Login to the source server and run the following command:

Stsadm -o backup -url http://sharepoint -filename c:\sharepoint.bak

Destination Server

Build out the destination server and run SharePoint configuration wizard, it is ok if you’ve already created a site collection on the target server because the new site will be overwritten by the -overwrite command below.

Warning – When you build out the new server you should try to build it using the same version and install all of the same Application Templates and binaries that were on the original server.

Stsadm -o restore -url http://sharepoint -filename c:\sharepoint.bak -overwrite

If you access the site immediately after restore here’s what you’ll see (if you restored it to a new domain)

image

Add a user via command line because the restored site will deny all of your login attempts (unless your server is on the same domain as the original source server – *** this post describes the steps for restoring to a different domain***)

Using the central administration console, you will note that the site collection still references the original administrators which are now invalid on this new domain.

>> Central Administration >> Application Management >> Site Collection Administrators

image

Run the command below to change ownership:

stsadm -o siteowner -url http://sharepoint -ownerlogin sharepoint\administrator

image

Now if you refresh central admin console you will see the new administrator as an owner, you can change the secondary administrator at this point as well.

image

Run the command below to add your new administrator to the site collection with the administrator role

stsadm -o adduser -url http://localhost -userlogin administrator -useremail test@test.com -role administrator -username administrator

clip_image005

Run IISRESET

Warning – Do not skip this step, you won’t be able to login until you run IISReset

clip_image006

Now you can refresh your main site and successfully login as the administrator.

Afterwards, you can optionally run this to clean up the old lingering logins explicitly

stsadm -o migrateuser -oldlogin olddomain\SPAdmin-newlogin newdomain\SPAdmin

VN:F [1.8.1_1037]
Rating: 10.0/10 (1 vote cast)
VN:F [1.8.1_1037]
Rating: 0 (from 0 votes)
Restoring a SharePoint Site Collection to a new domain10.0101

Popularity: 25% [?]

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

3 Responses to “Restoring a SharePoint Site Collection to a new domain”

  • sandip says:

    thanks good one…
    informative.

    UN:F [1.8.1_1037]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.1_1037]
    Rating: 0 (from 0 votes)
  • Efe S says:

    i couldnot directly recover to the first web application via your instructions, and created another web application, created site collection list with recovery command get “access is denied” deleted the site collection and recover then. however, “exception form hresult…” error. tried to recover from central admin backup (i have both stsadmin and central admin backups.) it was ok. but whenever i want to change the ownership with your command, got “object reference not set to an instance of an object” error.
    we have formatted the dc and created the same domain on another one. but the SIDs are not the same. all i want to do is running sharepoint. please help.

    UN:F [1.8.1_1037]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.1_1037]
    Rating: 0 (from 0 votes)
  • Leave a Reply:

    Name (required):
    Mail (will not be published) (required):
    Website:
    Comment (required):
    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Powered by eShop v.4