Tuesday, October 14, 2008

Move WSS3.0 databases from one SQL Server to another?

How to move WSS3.0 databases from one SQL Server to another?

Configuration:
WSS3.0 Server
Source SQL Server: Win 2003 Server SP2 SQL Server 2000 + SP4
Destination SQL Server: Win 2003 Server SP2 SQL Server 2000 + SP4

STEP1: BACKUP:

1] On Source SQL Server: Backup SharePoint Content databases.
Open SQL Server Enterprise manger
Right Click a database (For ex: WSS_Content)>All Tasks>Backup Database>Database Complete>Backup to disk>Add>Filename>Provide a path & filename>Ok>Ok
Repeat above procedure for all SharePoint databases however we will not restore all of them.
(Do not restore COnfiguraion & WSS_AdminContent... database on new SQL Server)
How to find name of Content databases:
Central Admin>Application Management>Content databases>Select web application from Right Hand Side Top drop down list
Database name will be displayed

-------------

2] On SharePoint Server: Take screenshots of all configured setting on Central administration page
For example:
Central Admin>Operations>Global Configuration>Alternate access mappings
Central Admin>Operations>Outgoing email settings
Central admin>Application management>Define managed paths
etc.

--------------

STEP 2: PREPARE DESTINATION SQL SERVER
We must install either same or Better version than Source SQL Server
Open SQL Server Enterprise manger
Security>Logins>Right Click>New Login
Add SharePoint Service Account in Domain\user format
This account must be either Domain admin or Domain user with Local admin rights on SharePoint server.
Security>Logins>Right Click Service Account>Properties>Server Roles Tab
Check Security Administrators & Database Creators
Click Ok

STEP 3: RESTORE CONTENT DATABASE TO DESTINATION SERVER
Copy backup Content database files to Destination SQL Server
Open SQL Server Enterprise manger
Databases>Right Click>All Tasks>Restore database>Restore as Database>Type name of Content Database>From device>Select device>disk>Add>Browse to backup files>Ok>Ok
Similarly restore all Content databases from backup
Security>Logins>Service Account>Database Access Tab>In upper pane select Content database>In lower pane check DB_OWNER checkbox>Click Ok

STEP 4: DISCONNECT FROM SOURCE SQL SERVER
On WSS3.0 Server
Run SharePoint Products and Technologies Configuration (PSCONFIG ) Wizard
-Select Disconnect from this server farm

-We should get configuration successful message.

STEP 5: CONNECT TO DESTINATION SQL SERVER
Run SharePoint Products and Technologies Configuration (PSCONFIG ) Wizard
-Select No, I want to create a new server farm

-Database Server: Give Destination SQL Server name
-Database Name: Type new Config Database Name
-Username: Use same Service account as used in existing old server
-Password: Password for that account

-We should get configuration successful message.
-After PSCONFIG finishes successfully Central admin page will open automatically.

STEP 6: RESTORING SITES FROM DATABASES

3.Create a new web application http://app on port 80 with content database name WSS_Content_TEST

1] Go to V3 Central Administration Page>Application Management>Create or extend Web Application

2] Click on Create a new web application

3] Choose any unused port no

4] Enter Database Server Name and enter Database name as WSS_Content_TEST

7] Wait for operation to complete

8]After application is created create a site collection

9] Fill the details and select Team site template click Ok

11] Browse to test site http://app

12] Check if it is working

To remove dummy_content_db from a web application

1] Click on Content Databases

2] On right hand side select the newly created web application if not already present
3] Click on Database name WSS_Content_TEST


4] Check remove content database checkbox and click OK

To attach restored content database to a new web application:
Open a command prompt and browse to
c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
Run following command
stsadm -o addcontentdb -url -databaseserver -databasename

Now browse to http://app and check if it is working
Similarly add content databases for other web applications.

STEP 7: POST MIGRATION TASKS

From the screenshots taken earlier we need to reconfigure central admin.
If site was using SSL we need to reapply it & change AAM.
We need to redo any customizations if lost after creating new configuration database.
If 3rd party web parts stop working we need to reinstall them.
Integration with other products needs to be reconfigured.
We need to assign the indexer to the sites from Central Admin>Application Management>Content databases>Select web application from Right Hand Side Top drop down list>Click on Database name>Select Search server from drop down list>Click Ok
Use "stsadm -o spsearch -action fullcrawlstart" to force instant crawling of sites.

NOTE:
=====
Do NOT discard Source SQL Server & Databases until the functionality of New SQL Server & WSS3.0 is tested & confirmed.

There are alternatives to above procedure but are quite tricky. :-)

No comments:

Total Pageviews