Use the API to loop through contacts and copy field value
I think you can use chain api to do this. Try using below snippet

$result = civicrm_api3('Contact', 'get', [
  'sequential' =&gt; 1,
  'return' =&gt; ["current_employer_id"],
  'custom_1' =&gt; ['IS NULL' =&gt; 1],
  'employer_id' =&gt; ['IS NOT NULL' =&gt; 1],
  'api.Contact.create' =&gt; [
    'id' =&gt; "\$value.id", 
    'custom_1' =&gt; "\$value.current_employer_id"
  ],
]);


(Replace custom_1 with custom field id from your system.)

HTH

Pradeep