[SalesForce] Changing custom field type

I need to change the field type of custom field from Text to Text Area (Long).
I have around 2000 records for an object requiring this change.
I also have apex and visualforce code referring to the custom field that requires change of type.
I plan to
1. comment apex and visualforce code accessing the field
2. change field type
3. uncomment and update the code to work with new type.

The question I have is, should I be doing step #2 above directly in Production environment using point & click or should I be doing this using change sets ?
I came across below note from the documentation –

"Changing a custom field type may require changing a large number of records at once. To process these changes efficiently, your request may be queued and you may receive an email notification when the process has completed."

based on above note, does it make sense to do this field type change (only Step # 2 above) directly in production (point & click) ?

any insight on this would be very helpful

Best Answer

Here is the process for this. It's painful and I've had to do this many times.

  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 new type.
  6. Deploy modified metadata from Step 4 into Production.

I always do this in the Force.com IDE as that is my preference, Change Sets are a bit cumbersome in my opinion. But you can use the Change Sets in Steps 3 and 5 to deploy.