Saturday, January 18, 2014

Content DB Restore by SQL DB move, showing zero sites

First of all i'll tell you the steps how to copy your existing Site DB to a new Server.
STEP1: BACKUP:

  1. On Source SQL Server: Backup SharePoint Content databases.
  2. Open SQL Server Enterprise manger
  3. 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
Question: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.

Step 2:Prepare the destination SQL server and Web server.

  1. Install the same versions of Service Packs for SQL and MOSS 2007, similar to your production server.
  2. Ensure you use the similar Admin user which would have full access as service account for both Web server and SQL server. (Check Security Administrators & Database Creators)
Step 3: RESTORE CONTENT DATABASE TO DESTINATION SERVER
  1. Copy backup Content database files to Destination SQL Server
  2. Open SQL Server Enterprise manger
  3. Create a database in your destination SQL, give the same name that of your backed up DB
  4. 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>
Step 4: RESTORING SITES FROM DATABASES
  1. Create a new web application http:// at port 80 with content database name WSS_Content_TEST ( this Database we will remove and replace with out backed up DB)
  2. Go to V3 Central Administration Page>Application Management>Create or extend Web Application
  3. Click on Create a new web application
  4. Choose any unused port no you can fancy
  5. Enter Database Server Name and enter Database name as WSS_Content_TEST
  6. Wait for operation to complete
  7. After application is created create a site collection, ( you can give any name eventually it'' not be used)
  8. Fill the details and select Team site template click Ok
  9. Browse to test site http://
  10. Check if it is working

    To remove WSS_Content_TEST from a web application
  11. Go to Central Administration, Central Administration > Application Management > Click on Content Databases
  12. On right hand side select the newly created web application if not already present
  13. Click on Database name WSS_Content_TEST
  14. 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 http:// -databaseserver Mossdev -databasename BackupDBName -assignnewdatabaseid
    Where Mossdev is my Database server name
    BackupDBName is my BackedUp Database that i've restored in SQL.

    Check if the sites collection has be restored in your new server
  15. Go to Central Administration, Central Administration > Application Management > Click on Content Databases
  16. On right hand side select the newly created web application if not already present
  17. Check the No. of sites in the site collection if its showing same no. that you had in your Restored Content DB webapplication.
  18. Then you are done with it. check the URL of the application, to view your restored Sharepoint Site.
Note: If still the new restored Content DB is showing "Current Number of Sites" is 0
Then there might be an existing Content DB id in your sharepoint installation configuration DB.
Here is the workaround. First find out the Id of the sites (site collection) in the [restored_db].Sites then delete the line in the [Config_db].SiteMap with the same Id. Now attach the content_db and you should see the sites.
Or what you can do is change the ID inside the [config_db].SiteMap to something else, maybe change a number.


Reference:

http://dhyansharepoint.blogspot.sg/2009/06/content-db-restore-by-sql-db-move.html


No comments:

Post a Comment

Image noise comparison methods

 1. using reference image technique     - peak_signal_noise_ratio (PSNR)     - SSI 2. non-reference image technique     - BRISQUE python pac...