[SalesForce] Pulling *full* Profile XML without hitting metadata limit

Need: I have a profile configured for the 'Salesforce Platform' license type, and need a version of it that works for the 'Salesforce' license (you can't clone a profile across license types using the UI)

Proposed Solution: I'd like to pull the (complete) XML for the Platform profile, change the <userLicense> tag from 'Salesforce Platform' to 'Salesforce', then deploy it to production as a new profile.

Attempted Process:

  1. To get the full set of permissions for a profile, and to deploy the new profile with all those permissions, I need to pull/deploy all metadata that relates to profile permissions: apex classes, VF pages, objects, field level security, etc.

  2. I used https://packagebuilder.herokuapp.com/ to build a package.xml of my Production org, including managed package metadata.

  3. I used SFDX CLI command sfdx force:mdapi:retrieve -r ./ -u Production -k ./package.xml to pull the metadata from my Production org, and hit the error The metadata retrieve operation failed: LIMIT_EXCEEDED: Too many files in retrieve call, limit is: 10000.

Question: The package.xml file for my full org has close to 30k metadata items in it, far beyond the 10k limit. How can I pull a profile with full info for the many classes/objects/fields/vf pages in my org, if it will exceed that limit?

Best Answer

Disclaimer: I work for Gearset

You could try Gearset's free trial for this - we automatically batch requests behind the scenes when retrieving metadata, as as long as no individual type has more than 10k items then you should be okay. If you include profiles for retrieval, we'll make sure each batch includes profiles, and then we'll stitch all the different results together behind the scenes so you get each complete profile.

If you want to try it out, just head to https://gearset.com and sign up for a free 30-day trial (takes two clicks, and doesn't require any card details, don't need to install anything in your org, etc.). You can grab the metadata either by configuring a backup job and downloading the resulting package.zip, or just running a comparison from org -> empty (but initialized) git repo. If you want to grab absolutely everything, make sure to switch on all metadata types - by default we pick a subset of about 70, but you can turn on the rest with another click or two!