function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ShunnShunn 

salesforce state and country picklist migration

Hi All,

Would anyone know If I can use visual studio code to move state and country picklist options from one org to the other?

Thank You,

​​​​​​​John
VinayVinay (Salesforce Developers) 
Hi Shunn,

You can use the Metadata API to edit existing states and countries in state and country picklists. You can’t use the Metadata API to create or delete new states or countries.  Should be good to use VS code to move state and country picklist.

Check below reference.
https://help.salesforce.com/articleView?id=sf.admin_state_country_picklists_api.htm&type=5

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
ShunnShunn
Thanks Vinay. I am looking to move state and country codes from Sandbox to Production. This would constitute as a new insert in the target org so this approach using the metadata API might not work?
You can’t use the Metadata API to create or delete new states or countries.
"To edit the existing states and countries in a picklist, configure your state and country picklists in your sandbox org.Then, use the Metadata API to retrieve the sandbox configurations, and deploy them to your production org. You can’t deploy new ISO codes or update ISO code values using any API."