Migrate values from custom field

Hi there,

I need to change the types of several custom fields, which means I need to create new custom fields and migrate values from these current custom fields to new ones.

What would be the best way?

Is it possible via API?

Thank you.