Attempted moving content and config databases to new server -- now I'm royally boned

Posted on 2010-01-07
Last Modified: 2012-05-08
Our current LAB and DEV environments are VMware based and house the database server inside the VM. Performance has gotten pretty terrible and as a result, I set about migrating the database portion of these servers to a physical database server to help performance woes. I read for days on how to move the content and configuration databases to another host so that I could smoothly transition from one server to another. Alas..

I did a test run on LAB using stsadm -o deletecontentdb -url http://myurl1 -databaseserver labdb -databasename myurl1db
I followed it up with another stsadm -o addcontent db -url http://myurl1 -databaseserver newdb\lab -databasename myurl1db

This worked. Eureka.

So I used the same process to revert it back to the original db. Again, success.

I wrote a short batch script to delete the content dbs for my 7 sites. The next step in the batch is to delete the config db... stsadm -o deleteconfigdb

Immediately afterwards, the config db is brought back online with stsadm -o setconfigdb -connect -databaseserver newdb\lab -databasename Sharepoint_Config -farmuser ad\someuser -farmpassword somepassword


Finally, the script readds all the sites to the new server as produced above.

Failure. States that a database of the same database id already exists. So i rewrite the adds to include "assignnewdatabaseid". They all load this way, but cannot load. Also, I have no admin page. Through much fuss, I attempt to back out and simply reattach to the original DB. Now the errors start. I can't complete a setconfigdb -- gives me a parameter error "value cannot be null, parameter name: str". So through much reading I attempt to reverse this a step deeper using psconfig -cmd configdb. It runs successfully. However, still getting the value cannot be null, parameter name: str error when attempting to attach contentdbs. Further, my inetpub directory is now EMPTY!

How did this happen? What can I do?? Fortunately this is LAB, but I need to thoroughly understand this!
Question by:jmicorp
    LVL 19

    Accepted Solution

    One thing that I'm already missing is the
    Stsadm o preparetomove contentdb myurl1db

    I would suggest trying to do it by adding that command first.

    Author Comment

    I hadn't seen the first mention of this tool. Is this necessary when moving the MDF/LDF pairs for the database from one server to another? From what I can tell from the technet description, this command is used for moving just the content inside the DB, not the db itself.

    i've got a backup from the night before with inetpub still completely intact (not to mention the whole file system). how might one suggest getting this back??

    Author Comment

    i've tried -deleteconfigdb .. had to run it twice before it actually completed successfully.

    now, psconfig -cmd configdb -connect -server -dbuser -dbpassword -user -password

    Fails telling me that no matter what database I use, its invalid. "The server parameter specified with the configdb command is invalid."

    i've triple checked to ensure that my strings are correct. When I inspect failed configuration installation logs, I'm getting errors stating:

    01/08/2010 14:02:57  9  ERR                                                Task configdb has failed
    01/08/2010 14:02:57  9  INF                                                friendlyMessage for task configdb is An exception of type System.ArgumentNullException was thrown.  Additional exception information: Value cannot be null.
    Parameter name: str
    01/08/2010 14:02:57  9  INF                                                debugMessage for task configdb is An exception of type System.ArgumentNullException was thrown.  Additional exception information: Value cannot be null.
    Parameter name: str
    System.ArgumentNullException: Value cannot be null.
    Parameter name: str
       at System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[] str)
       at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
       at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
       at Microsoft.SharePoint.Administration.SPFileSystemCache.GetFileInfoFromId(Guid objectId)
       at Microsoft.SharePoint.Administration.SPFileSystemCache.PutObjectInFileSystem(SPPersistedObject obj)
       at Microsoft.SharePoint.Administration.SPFileSystemCache.SetValue(Guid id, SPPersistedObject obj)
       at Microsoft.SharePoint.Administration.SPCache`2.set_Item(K key, V value)
       at Microsoft.SharePoint.Administration.SPConfigurationDatabase.RefreshCache(Int64 currentVersionOverride, List`1& newObjects, List`1& deletedObjects, Int64& newestObjectVersion)
       at Microsoft.SharePoint.Administration.SPConfigurationDatabase.RefreshCache()
       at Microsoft.SharePoint.Administration.SPConfigurationDatabase.StoreObject(SPPersistedObject obj, Boolean storeClassIfNecessary, Boolean ensure)
       at Microsoft.SharePoint.Administration.SPConfigurationDatabase.PutObject(SPPersistedObject obj, Boolean ensure)
       at Microsoft.SharePoint.Administration.SPPersistedObject.Update()
       at Microsoft.SharePoint.Administration.SPWebApplication.ApplyWebConfigModifications()
       at Microsoft.SharePoint.Administration.SPWebApplication.Provision()
       at Microsoft.SharePoint.Administration.SPWebServiceInstance.Provision()
       at Microsoft.SharePoint.Administration.SPFarm.Join()
       at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.CreateOrConnectConfigDb()
       at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.Run()
       at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()

    Open in new window

    LVL 13

    Assisted Solution

    I've seen this with publishing sites (or the collaboration portal).  If memory serves, it was related to the site directory and sites registered within.  anyways, I seem to recall giving up and instead, recreating the farm and restoring the web applications and content databases to it because with a new farm, the config database is recreated and the serial numbers will now all be unique.  In my case, we couldn't afford to be down longer, so it was quicker to build the farm and take it as a 'house cleaning' opportunity.
    LVL 51

    Expert Comment

    I'd recommend you contact Microsoft Support.  Sharepoint is very sensitive to configuration changes.  For example, if you didn't block all access to the Sharepoint sites and stop all Sharepoint services while making these changes your configuration might be damaged.

    Author Comment

    Itgroove, youre mostly right. What I was doing wrong was trying to reuse the Sharepoint configuration databases. I pulled them into offline mode, started the configuration wizard from the server again, gave it a specific db name instead of "SHAREPOINT_CONFIG" and let it build itself over. Once I had the system alive, I readded each web, pointing to the appropriate inetpub folder and sql database for the existing application. I had to reload all addins/wsp's/etc after I attached all the application(s). Further, I had to apply any customizations to the SSP. Learning experience!

    Author Closing Comment

    I ended up answering my own question, but itgroove was correct and shadow had good input.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
    Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
    The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now