I have done several Configmgr 2007 to Configmgr 2012 migrations, and so far all of them have been without to many issues. Well, that is, until this week. I was starting to migrate more than a 100 ConifgMgr 2007 sites into a single Configmgr 2012 primary site (YES, no CAS). After creating the source connecting to the ConfigMgr 2007 Central site, I received this error in the migmctrl.log file

The error

By reading the log file I could see that most of my objects were successfully analyzed and could be migrated. The error came was shown in the middle of analyzing collections.

image

ERROR: [Worker]: System.Data.SqlClient.SqlException: The statement terminated. The maximum recursion 100 has been exhausted before statement completion. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream,

Solving the error

Usually errors like that are not related to the new ConfigMgr 2012 environment but to the old ConfigMgr 2007 environment. In ConfigMgr 2007 I checked the status messages and could see that the policypv.log  was filled with the same error. In the log file notice that it’s failing trying to execute a SQL SP. The stored procedure has a single argument with in this case is the Collection ID. For some reason ConfigMgr is unable to update a specific collection which has collection id 1828

image

 

To find the collection I had to do something that “IS NOT SUPPORTED AND SHOULD NEVER BE DONE IN A PRIDUCTION ENVIRONMENT” I went in to the SQL database and created a select statement Select * from collections where collectionID = 1828

image

 

After getting the collection name I started looking in the ConfigMgr Admin console to find the collection. The collection didn’t exist in the console so I ended up deleting the collection using a SQL statement. removing collection from the database also removed all the errors inthe log file. Back in the ConfigMgr 2012 console I was now able to run a successful migration.

 

image

 

Warning: It is not supported to modify the ConfigMgr database in any way.