Link to home
Start Free TrialLog in
Avatar of ascendix
ascendixFlag for United States of America

asked on

Error when upgrading from MSCRM v3 to v4

Has anyone seen anything like this before?  This is what the error log shows.

12:46:51|  Error| System.Exception: Action Microsoft.Crm.Setup.Server.ImportDefaultDataAction failed. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Crm.Tools.ImportExportPublish.ImportRelationshipAttributeProperties.AddMissingLookupValues(XmlDocument fieldXmlDocument)
   at Microsoft.Crm.Tools.ImportExportPublish.ImportRelationshipAttributeProperties.PerformUpgrade()
   at Microsoft.Crm.Tools.ImportExportPublish.ImportHandler.Import()
   at Microsoft.Crm.Tools.ImportExportPublish.RootImportHandler.RunImport()
   at Microsoft.Crm.Tools.ImportExportPublish.ImportXml.RunImport()
   at Microsoft.Crm.Setup.Server.Utility.NewOrgUtility.OrganizationImportDefaultData(Guid organizationId, Version existingDatabaseVersion, String importFile)
   at Microsoft.Crm.Setup.Server.ImportDefaultDataAction.Do(IDictionary parameters)
   at Microsoft.Crm.Setup.Common.Action.ExecuteAction(Action action, IDictionary parameters, Boolean undo)
   --- End of inner exception stack trace ---, Error, RetryCancel, Option1

What is on the screen is this with a retry and a cacel option
Action Microsoft.Crm.Setup.Server.ImportDefaultDataAction failed.
Object reference not set to an instance of an object.

Avatar of WilyGuy
WilyGuy
Flag of United States of America image

What was the state of your CRM 3.0 before upgrade?

It looks like there were some missing relationships based on the second line of the error.

Did you have C360 add-ins installed by chance?

About how far thru the upgrade are you? (do you have a MSCRM_CONFIG Database?, is the Org_METABASE DB gone?)
Can you add your CRM40Setup.log file?
Avatar of ascendix

ASKER

No C360 components as far as I know
crm40setup.log
Can you make sure that The user who is trying to install has access to database
As far as how far through the upgrade I am.  I have gone past all the checks for the v4 upgrade and the status bar is going through its paces.  This is about 5 - 10 minutes into the upgrade process after the actual install/upgrade button is pressed.  The metabase database is still there, I do not have the Config database yet.
OK, so the latest log is likely your "second try".  It indicates that CRM is not installed.

My guess is you cancelled the upgrade, but didn't reinstall 3.0? (if the upgrade fails you have to restore your databases and reinstall 3.0, pointing to the existing databases).

I did not see the error you indicated above in this log, unfortunately, so I don't know where in the sequence it is failing.

You are saying "grrrr" (I know I've been there).  If you can get to that point again and send the log, that would be great.

You may also want to start a SQL Profile trace to see what is happening on that side as well.
Also, just to make sure you know, ALWAYS choose to update the install files (even if you have done it before, the installer won't use the ones already downloaded unless you choose to Update)
Here is the actual upgrade log.  I have restored and re-installed v3 a number of times.
Here is the crm40svrsetup.log that shows the error.

crm40svrsetup-1.zip
The install files are updated.
Hi  

 I searched the net and found this for you

http://www.techreplies.com/windows-crm-79/crm-4-0-upgrade-failed-error-714356/

Kesh Patel of australia posted this answer below hope this helps


* * * * * * * I fixed the problem following way * * * * * do not
panic It works....

1. From CRM 4.0 server setup log file find out which CRM object number
successfully processed before the error.

2. In my case last object successfully process was 4202 (Email) using
this number 4202 go up in the log file and find <Node
name="EntityContextNode" info="4202"> and then check what is the next
node ..object number? In my case it was 3 so I figured out that it is
opportunity object which contains duplicate fields xml.

3. Go to _MSCRM database in sql server and open the table
OrganisationUIBase and I executed following query

SELECT FieldXml, ObjectTypeCode, InProduction
FROM OrganizationUIBase
WHERE (ObjectTypeCode = 3) AND (InProduction = 1)

4. Now copy all the content of Fieldxml using Ctl + A and paste in to
Visual studio 2003/2005 new xml file and format the content in proper
xml look. I saved this file as opportunity.xml and opened in Excel and
save again as opportunity.xls.

5. I then open new mdb file in Access and imported this
opportunity.xls file as a table and then used duplicate find query
wizard on field 'description' and then modify the query having 'value'
filed as null. Then I filtered reguler picklist/option fileds having
duplicate 'description'. After that It gave me a list of actual
duplicate fields.I was able to find 2 duplicate

one was new_singoff and other was and new_threats.

6. I then opened CRM 3.0 and went in to setup and exported opportunity
object only xml using selective export and saved as
Customisation_opportunity.xml and then opend in VS studio and
find for above 2 fileds one by one.

<field name="new_signoff" requiredlevel="na" maxlength="100"
format="text">
<displaynames>
<displayname description="Sign Off" languagecode="1033" />
</displaynames>
</field>

(When you search you will find 2 occurrences of each them)

I deleted duplicate definition node only looking like as above(there
where 2 of them - A BIG bug !!!!! Microsoft please
correct the CRM 4.0 Upgrade Install programme to cater for this)

I did the same with second duplicate field xml

7. Save the XML and re-import this corrected
Customisation_opportunity.xml in to CRM and published and then I used
published all as well.

BINGO... You are ready for CRM 4.0 Upgrade...as long as you do not
have duplicate fields xml in another table. Hopefully not else again
find out on which object it crashes and repeated above steps.

Hopefully this helps

 Credit gose Kesh.

I think we are on the right track but this error is different than his:
THAT URL: System.ArgumentException: An item with the same key has already been
 added.
HIS PROBLEM: System.NullReferenceException: Object reference not set to an instance of an object.


I am looking at his very verbose log and did a search for the 4204, which appears to be the Fax Activity.  Is there any customization done on this?
WilyGuy, no customizations that we can tell.  We have set that back to default.  

What we thnk is that it may be erroring out on the next objecttype but not giving the number..  

Is there any way to determine the order that the upgrade is working the entities?
ASKER CERTIFIED SOLUTION
Avatar of WilyGuy
WilyGuy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yours is number 1, Accounts....
Yep, looking into that Entity right now.  That entity was customized.

Thanks
So where are you with the upgrade?
The error was caused from an a customization that was not done through the GUI.  We exported the customization, then modified the XML to have the correct relationship, then imported the customizations back into a clean v3 CRM system.  Then the upgrade process worked fine.

Thanks for the help.
Thanks for your help.  This helped us nail down the offending entity although we could not save the original DB we where able to save the customizations for upgrade.
You couldn't import the fixed customizations into the current system?
No, the issue was that a relationship was set up and set as a system relationship.  We could not drop it, nor when we imported the fixed xml would it update the existing relationship record to set it to not be a system relationship.

Thanks
ah, then yes it wouldn't work.  So how are you planning to move your data?