Move SharePoint Content Databases
Several common reasons for needing to move a content database from one SQL server to another are:
•Scalability (spreading the load of your SQL server across multiple SQL servers)
•Disaster Recovery (your SQL server had a catastrophic disaster and you need to recover from that event)
•Database Reorganization (you simply need to change the server that hosts your content database or rename the database)
Instructions for moving a content database from one SQL server to another
1.Detach the content database from the source SQL server and copy the .mdf and .ldf to the target SQL server. (Note: while you are moving the database files your users will see “Cannot connect to content database” when visiting their site)
2.Attach the .mdf and .ldf files on the target SQL server as a new database (Note: this is your opportunity to rename the database if you desire)
3.Run the following stsadm commands from the command line on your SharePoint server to complete the move: (Note: the deletecontentdb does not actually delete the database from SQL server, it simply disconnects the database from SharePoint)
stsadm –o deletecontentdb –url http://yoursiteurl –databasename your_content_db –databaseserver source_SQL_server
stsadm –o addcontentdb –url http://yoursiteurl –databasename your_content_db –databaseserver target_SQL_server
Move SharePoint Configuration Database
Several common reasons for needing to move your configuration database from one SQL server to another are:
•Disaster Recovery (your SQL server had a catastrophic disaster and you need to recover from that event)
•Database Reorganization (you simply need to change the server that hosts your content database or rename the database)
Instructions for moving a configuration database from one SQL server to another
1.Backup configuration database from the source SQL server
2.Restore the backup onto the target SQL server (Note: this is your opportunity to rename the config database if desired)
3.Run the following stsadm commands from the command line on your SharePoint server to complete the move: (Note: the deleteconfigdb does not actually delete the database from SQL server, it simply disconnects the database from SharePoint)
stsadm -o deleteconfigdb
stsadm –o setconfigdb -connect –databaseserver target_SQL_server -databasename databasename -farmuser your_farm_sql_account -farmpassword your_farm_sql_password
The complete syntax for the stsadm -o deleteconfigdb is listed below: (Note: there are NO options)
stsadm.exe -o deleteconfigdb
The complete syntax for the stsadm -o setconfigdb is listed below:
stsadm.exe -o setconfigdb
[-connect]
-databaseserver
[-databaseuser
[-databasepassword
[-databasename
[-hh]
[-exclusivelyusentlm]
[-farmuser]
[-farmpassword]
[-adcreation]
[-addomain
[-adou
No comments:
Post a Comment