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

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!
Who is Participating?
MsShadowConnect With a Mentor Commented:
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.
jmicorpAuthor Commented:
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??
jmicorpAuthor Commented:
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

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

itgrooveConnect With a Mentor Commented:
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.
Ted BouskillSenior Software DeveloperCommented:
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.
jmicorpAuthor Commented:
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!
jmicorpAuthor Commented:
I ended up answering my own question, but itgroove was correct and shadow had good input.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.