How to Delete A Field and Retain Its Value? I created a new field called field_code_file and I transferred all the value from field_code. Reference here.

Now if I delete the old field called field_code, the value in field_code_file is also deleted. So how can I delete field_code by retaining the value in field_code_file?

BTW, not only the value that is being deleted but also the files. What I'm doing is simply restore the files from the backup. The only problem I have is to retain the value in the table, whatever table it is.

Anyone can help me, please?
I'm not sure this can help you, but one solution that I can suggest is to update your nodes (instead of directly querying the database): transfer one field values to the second one and save it then delete the first one. You can use entity_metadata_wrapper or just functions that are provided by node module.
You can try something like this... Example:

$nodes = node_load_multiple(array(), array('type' =&gt; 'MY_CONTENT_TYPE'));
foreach($nodes as $node) {
  $node_wrapper = entity_metadata_wrapper('node', $node);
  $field_code = $node_wrapper-&gt;field_code-&gt;value();
  $node_wrapper-&gt;field_code_file-&gt;set($field_code);
  $node_wrapper-&gt;save();
}