+ Start a Discussion
Anuj Joshi 16Anuj Joshi 16 

Migrating Roles using ANT

Hi,

I have roles in one org which have to be migrated into other org. The migration has to be done in such a way that all roles should come under a specific role present in other org. If I deploy AS-IS the roles are created are being created at the bottom
NagendraNagendra (Salesforce Developers) 
Hi Anuj,


These items are supported by the metadata API, so you can use the likes of Eclipse/Force CLI/Migration tool. However, you need API access, So if you are on Professional Edition the answer will be no.

If the org's are joined (i.e. sandbox/production, sandbox/sandbox) you also have the option of change sets, but if you are looking to migrate from one dev org to another you can't use this mechanism.

There is also a hacky solution for migrating roles in salesforce.
It involves using the Apex Data Loader to export/import the Role table and using some CSV parsing scripts to parse and manipulate values. (Unfortunately, it doesn't help when it comes to sharing rules)

If you need something now, hopefully,this will help: http://stephenscholtz.com/201201/migrating-role-hierarchy-between-environments-salesforce

For more ideas check here: Kindly mark this post as solved if the information help's so that it gets removed from the unanswered queue and becomes a proper solution which results in helping others who are really in need of it.

Best Regards,
Nagendra.P