Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1285
diff -u -p -r1.1285 common.inc
--- includes/common.inc	14 Jan 2011 08:37:20 -0000	1.1285
+++ includes/common.inc	3 Feb 2011 11:51:06 -0000
@@ -7773,3 +7773,37 @@ function drupal_get_filetransfer_info() 
   }
   return $info;
 }
+
+/**
+ * Renames a persistent variable.
+ *
+ * Case-sensitivity of the variable_* functions depends on the database
+ * collation used. To avoid problems, always use lower case for persistent
+ * variable names.
+ *
+ * @param $name
+ *   The current name of the variable to change.
+ * @param $new_name
+ *   The new name of the variable to change.
+ *
+ * @see variable_get()
+ * @see variable_set()
+ * @see variable_del()
+ */
+function variable_rename($name, $new_name) {
+  global $conf;
+  
+  if (isset($conf[$name])) {
+
+    db_update('variable')
+      ->fields(array(
+        'name' => $new_name,
+      ))
+      ->condition('name', $name)
+      ->execute();
+    cache_clear_all('variables', 'cache_bootstrap');
+  
+    $conf[$new_name] = $conf[$name];
+    unset($conf[$name]);
+  }
+}
\ No newline at end of file
