When importing an organization into CRM, you may encounter the following error message:
At least the setup user needs to be mapped before this organization can be imported
There are a few steps you may need to take to resolve this issue:
Determine the Status of Your User
The following query will tell you about the user you are attempting to import the organization with:
select systemuser.domainname, rolebase.name, roles.systemuserid, systemuser.accessmode, systemuser.setupuser
from systemuserroles roles
inner join systemuser on roles.systemuserid = systemuser.systemuserid
inner join rolebase on rolebase.roleid = roles.roleid
where domainname = '{domain}\{username}'
Example results:
domainname {domain}\{username}
name System Customizer
systemuserid {GUID}
accessmode 1
setupuser 0
'Name' should be System Administrator
Your user should have the role of System Administrator to import the organization. Determine the correct GUID from the rolebase table for the System Administrator role, and update the systemuserroles for your systemuserid.
Accessmode and Setupuser values
Accessmode is used to specify whether the user is allowed to run the CRM setup program. For some reason setting this to false i.e. '0' has proven to help resolve the issue. In addition the setupuser value has to be set to true i.e. '1'.
When these values have been set, restart the Deployment Manager and import your organization!