in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

adnan's blog

Move MOSS 2007 Web Application to another server

How to migrate MOSS 2007 Web Application to across servers

SharePoint Portal Server 2007 central administration provides web interface to take Web Application (formerly called portal site in SPS 2003) backup and restore, but sometime, database restore fails due to number of reasons. The work around to move SharePoint 2007 web application is to take content database backup and restore it on destination (either same or different domain) and attach the database by using STSADM command line tool.

Steps required moving web application is defined below:

Step # 1: Identify Content Database (s) of Web Application

  • Open MOSS 2007 Central Administration
  • Go to "Application Management" Tab and Click link "Site Collection List" under "SharePoint Site Management".
  • You can Content Database Name under database column as shown in the figure below.

Step # 2: Content Database Backup

  • After identifying the content database in the previous step, take the identified database backup by using SQL Server 2005 Management Studio.

Step # 3: Restore Content Database on Destination Server

  • Logged into Destination Server and restore content database by using SQL Server 2005 Management Studio

Step # 4: Create New Web Application on Destination Server

  • Open MOSS 2007 Central Administration on destination server.
  • Go to "Application Management" Tab and Click link "Create or extend Web Application" under "SharePoint Web Application Management".
  • Next Screen click "create a new web application".

Step # 5: Detach/Remove Content Database of Web Application

  • Click "Content Databases" under "SharePoint Web Application Management" on Application Tab.
  • Next Page, Select you’re newly created web application and then click content database as shown in the figure below.

Note:  Normally content database name is WSS_Content_[GUID].

  • Next Page, Choose "Remove Content Database", you will get a warning message.
  • Click "OK".

See figure below:

  • Click "OK" button at the bottom of the page to remove content database.

Step # 6: Attach Content Database of Web Application

  • Now there is no content database associated with web application.
  • In order to attach content database restored on Step # 3, we will use STSADM command line tool.
  • Open Command Prompt, navigate to folder "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\"

·         Run the following Command:

        stsadm -o addcontentdb -url [http://webapplication:port] -databasename [WSS_Content_GUID] -databaseserver [Database Server Instance]

  • Replace URL, databasename and database server name according to your scenario.
  • After running the command you will get a message “Operation completed successfully”.
  • Now restart IIS by running IISRESET Command on command prompt.

Browse the web application again and you will see that web application is restored successfully with full functionality.

Comments

 

basquang said:

Thanks Adnan, this is a good article

June 20, 2008 10:06 AM
 

Nadeem said:

After taking Applications backup from source server.

At step #3 , we have to restore it on destination server.As mention restore on destination but on which database we have to restore .Please make it clear.

Thanks

Nadeem

June 25, 2008 1:21 AM
 

Mehmood said:

Hi,

  i took a backup from serverA and created one dummy database on serverB and restored on dummy database.Upto now its working fine.

but when i try to addcontentdb thru stsadm, i m getting this error.

"The specified SPContentDatabase Name=DummyDatabase Parent=SPDatabaseServiceInstance has been upgraded to a newer version of SharePoint. Please upgrade this SharePoint application server before attempting to access this object."

Please provide me a solution for this.

Thanks

Mehmood

June 25, 2008 5:48 AM
 

Prakash said:

i m also same problem as Mehmood

any way out

Thanks

June 25, 2008 5:50 AM
 

Tal Winter said:

The Content DataBase was added succesfully but i get this error: Exception from HRESULT: 0x80041050 when i try to browse to the Top Site Collection and other sites under it.

Actually, i get this error message on every site.

Any idea?

July 1, 2008 5:35 AM
 

Mandita26 said:

HELLO Mehmood and Prakash,

The problem sounds to be the look like the version mismatch. When u back up your database what was the service pack level and what were the hotfixes installed. It should be the same on the server you are restoring it. this might help

August 6, 2008 2:16 PM
 

JasonCoetzee said:

Hi, is it as simple as restoring the DB and attatching it to a new Web app?  I complete everything successfully but I cant see the new web application.

August 15, 2008 11:13 AM

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts