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
AmarjeetAmarjeet 

Changed datatye of field migration to PROD-failed due to exixting data?

Changed datatype from text to textarea of a field, migration to PROD-failed due to existing data? How to mitigate this without doing that manually?
Khan AnasKhan Anas (Salesforce Developers) 
Hi Srikant,

Greetings to you!

You have to do the same change manually in Production and then perform the deployment. Or create a new field then migrate data from the old field to the new one.
  1. Backup your Object Records Data into Excel, Backup Database, ETC. Backup your Salesforce Configuration (Metadata) using Force.com IDE or similar tool.
  2. Comment All References to the field in your metadata (Apex Code / Visualforce / Workflows /etc) in Sandbox.
  3. Change Field Type in Sandbox.
  4. Deploy modified metadata from Step 1 from Sandbox to production.
  5. Uncomment code/metadata/ etc from Step 1 and modify as needed for a new type.
  6. Deploy modified metadata from Step 4 into Production.

Note: You can't comment Apex Code in Production so you have to do deploy process

Reference: https://salesforce.stackexchange.com/questions/48104/changing-custom-field-type

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas