locked
Example Needed for AssignNewDatabaseId used in PowerShel Command RRS feed

  • Question

  • Hi all,

             I am using Mount Command for Moving Content Database of 1 web application to another web application,Can any one provide me example on AssignNewDatabaseId .I am following http://technet.microsoft.com/en-us/library/ff607581.aspx but not able to solve the problem can any one provide me example .


    Thanks, Quality Communication Provides Quality Work. Siddiqali Mohammad .

    Wednesday, June 6, 2012 5:40 AM

All replies

  • simply run the command:

    $dbname = "WSS_Content_SomeDBName"
    $dbserver = "SomeDBServerNAme"
    $webAppUrl = "http://someurl.company.com"
    
    $newDB = Mount-SPContentDatabase $dbName -DatabaseServer $dbServer -WebApplication $webAppUrl -AssignNewDatabaseId
    
    Write-Host -object "Database mounted successfully with ID: " + ($newDB.Id)


    Dirk Van den Berghe

    • Marked as answer by SP Assest Wednesday, June 6, 2012 9:09 AM
    • Unmarked as answer by SP Assest Wednesday, June 6, 2012 10:28 AM
    Wednesday, June 6, 2012 8:36 AM
  • HI Dirk,

                Thanks for response,Through Mount Command I am able to move Content Database .But my existed web-application is having 2 sites .After Running Mount Command I am unable to c the 2 sites in my new wen application.The below image is mount command i.e I had used and worked fine  to move content database.


    Thanks, Quality Communication Provides Quality Work. Siddiqali Mohammad .


    • Edited by SP Assest Wednesday, June 6, 2012 10:49 AM
    Wednesday, June 6, 2012 10:34 AM
  • Hello,

    i have the same issue in SharePoint 2013.

    CurrentSiteCount is also "0" in my case.

     I tried this but without success.

    $db = Get-SPContentDatabase 'TestRestoreDB'

    $db.RefreshSitesInConfigurationDatabase()

    Does anyone have a solution?

    Thx a lot

    Regards Mario

    Thursday, July 31, 2014 8:32 AM