diff --git a/field_tools.admin.inc b/field_tools.admin.inc
index 63bb1b9..0cc23ff 100644
--- a/field_tools.admin.inc
+++ b/field_tools.admin.inc
@@ -463,6 +463,374 @@ function field_tools_field_clone_form_submit($form, &$form_state) {
 }
 
 /**
+ * Export all fields of a bundle
+ *
+ * @param string $form 
+ * @param string $form_state 
+ * @param string $entity_type 
+ * @param string $bundle 
+ * @return void
+ */
+function field_tools_bundle_export_form($form, $form_state, $entity_type, $bundle) {
+  
+  // Get the bundle name if the bundle name is really a bundle object.
+  $bundle_name = is_object($bundle) ? $bundle->type : $bundle;
+
+  $instances = field_info_instances($entity_type, $bundle_name);
+
+  $options_fields = array();
+  foreach ($instances as $field_name => $field) {
+    $options_fields[$field_name] = $field['label'];
+  }
+
+  $form['fields'] = array(
+    '#title' => t('Fields to export'),
+    '#type' => 'checkboxes',
+    '#options' => $options_fields,
+    '#description' => t("Select fields that you want to export."),
+  );
+
+  if (module_exists('field_group')) {
+    $groups = field_group_info_groups($entity_type, $bundle_name, 'form');
+    $options_groups = array();
+    foreach ($groups as $group_name => $group) {
+      $options_groups[$group_name] = $group->label;
+    }
+    $form['groups'] = array(
+      '#title' => t('Groups to export'),
+      '#type' => 'checkboxes',
+      '#options' => $options_groups,
+      '#description' => t("Select groups that you want to export."),
+    );
+  }
+  
+
+  if (isset($form_state['storage']['fields'])) {
+    
+    $export_fields = array_filter($form_state['storage']['fields']);
+    $export = array();
+    foreach ($export_fields as $field_name) {
+      $instance = $instances[$field_name];
+      $export[] = field_tools_get_field_code($instance);
+    }
+  
+    if (module_exists('field_group')) {
+      $export_groups = array_filter($form_state['storage']['groups']);
+      $groups = field_group_info_groups($entity_type, $bundle_name, 'form');
+      foreach ($export_groups as $group_name) {
+        $group = $groups[$group_name];
+        $export[] = field_tools_get_group_code($group);
+      }
+    }
+  
+    $code = implode("\n", $export);
+    $form['code'] = field_tools_textarea(t('Export code'), $code);
+  }
+  
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Continue'),
+  );
+  
+  return $form;
+}
+
+function field_tools_bundle_export_form_submit($form, &$form_state) {
+  
+  $form_state['rebuild'] = TRUE;
+  $form_state['storage']['fields'] = $form_state['values']['fields'];
+  if (module_exists('field_group')) {
+    $form_state['storage']['groups'] = $form_state['values']['groups'];
+  }
+  
+}
+
+/**
+ * Import fields into a bundle
+ *
+ * @param array $form 
+ * @param array $form_state 
+ * @param string $entity_type 
+ * @param string $bundle 
+ * @return void
+ */
+function field_tools_bundle_import_form($form, $form_state, $entity_type, $bundle) {
+  $form = array();
+  $form['#entity_type'] = $entity_type;
+  $form['#bundle'] = is_object($bundle) ? $bundle->type : $bundle;
+  $form['code'] = field_tools_textarea(t('Field code'));
+  $form['code']['#required'] = TRUE;
+  $form['code']['#description'] = t('Paste the code of one or more previously exported fields.');
+  $form['actions']['import'] = array(
+    '#type' => 'submit',
+    '#value' => t('Import'),
+  );
+  $form['actions']['import_force'] = array(
+    '#type' => 'submit',
+    '#value' => t('Import (skip validation)'),
+  );
+  return $form;
+}
+
+/**
+ * Validation callback for the import form.
+ *
+ * @param array $form 
+ * @param array $form_state 
+ * @return void
+ */
+function field_tools_bundle_import_form_validate($form, &$form_state) {
+
+  if ($form_state['values']['op'] == $form_state['values']['import_force']) {
+    return;
+  }
+
+  eval($form_state['values']['code']);
+  $entity_type = $form['#entity_type'];
+  $bundle = $form['#bundle'];
+  $error = FALSE;
+
+  if (isset($fields) && count($fields)) {
+    foreach ($fields as $field_name => $item) {
+      
+      $field_type = field_info_field_types($item['field']['type']);
+      if (!$field_type) {
+        drupal_set_message(t('Unknown field type %field_type. Field %field_name will not be created.', array(
+          '%field_type' => $item['field']['type'],
+          '%field_name' => $field_name,
+        )), 'error');
+        $error = TRUE;
+        continue;
+      }
+
+      $instance = field_info_instance($entity_type, $field_name, $bundle);      
+      if ($instance) {
+        drupal_set_message(t('Bundle %bundle already contains the field %field.', array(
+          '%field' => $field_name,
+          '%bundle' => $bundle,
+        )), 'error');
+        $error = TRUE;
+      }
+      
+    }
+  }
+  
+  if (isset($groups) && count($groups)) {
+    foreach ($groups as $group_name => $group) {
+      
+      $existing_groups = field_group_read_groups(array('name' => $entity_type, 'bundle' => $bundle));
+      
+      if (isset($existing_groups[$entity_type][$bundle][$group->mode][$group_name])) {
+        drupal_set_message(t('Bundle %bundle already contains the group %group.', array(
+          '%group' => $group_name,
+          '%bundle' => $bundle,
+        )), 'error');
+        $error = TRUE;
+        continue;
+      }
+      
+    }
+  }
+  
+  if ($error) {
+    form_set_error('code');
+    $form_state['test'] = 'test';
+    $form_state['rebuild'] = TRUE;
+  }
+}
+
+/**
+ * Submit handler for the import form.
+ *
+ * @param array $form 
+ * @param array $form_state 
+ * @return void
+ */
+function field_tools_bundle_import_form_submit($form, &$form_state) {
+
+  eval($form_state['values']['code']);
+  $entity_type = $form['#entity_type'];
+  $bundle = $form['#bundle'];
+  
+  if (isset($fields)) {
+    field_tools_import_fields($entity_type, $bundle, $fields);
+  }
+  
+  if (isset($groups) && count($groups)) {
+    field_tools_import_groups($entity_type, $bundle, $groups);
+  }
+  
+}
+
+/**
+ * Export a single field
+ *
+ * @param array $form 
+ * @param array $form_state 
+ * @param array $instance 
+ * @return void
+ */
+function field_tools_field_export_form($form, $form_state, $instance) {
+
+  $form = array();
+  $form['code'] = field_tools_textarea(t('Field code'), field_tools_get_field_code($instance));
+  
+  return $form;
+}
+
+/**
+ * Export a single group
+ *
+ * @param array $form 
+ * @param array $form_state 
+ * @param array $instance 
+ * @return void
+ */
+function field_tools_group_export_form($form, $form_state, $group) {
+  
+  $form = array();
+  $form['code'] = field_tools_textarea(t('Group code'), field_tools_get_group_code($group));
+  
+  return $form;
+  
+}
+
+/**
+ * Retrieve a code representation of the given field instance.
+ *
+ * @param array $instance 
+ * @return string
+ */
+function field_tools_get_field_code($instance) {
+  
+  $data = array();
+  $entity_name = $instance['entity_type'];
+  $bundle_name = $instance['bundle'];
+  $field_name = $instance['field_name'];
+  $data[$field_name] = array(
+    'field' => field_info_field($field_name),
+    'instance' => field_info_instance($entity_name, $field_name, $bundle_name),
+  );
+  
+  ctools_include('export');
+  return '$fields[\'' . $field_name . '\'] = ' . ctools_var_export($data[$field_name]) . ';';
+}
+
+/**
+ * Retrieve a code representation of the given field group.
+ *
+ * @param object $group 
+ * @return string
+ */
+function field_tools_get_group_code($group) {
+  unset($group->id);
+  unset($group->identifier);
+  unset($group->bundle);
+  unset($group->entity_type);
+  $group_name = $group->group_name;
+  ctools_include('export');
+  return '$groups[\'' . $group_name . '\'] = ' . ctools_var_export($group) . ';';
+}
+
+/**
+ * Import fields to a bundle
+ *
+ * @param array $fields 
+ *  As obtained from field_tools_get_field_code().
+ * @param string $bundle_name 
+ * @param string $entity_type 
+ * @return void
+ */
+function field_tools_import_fields($entity_type, $bundle_name, $fields) {
+  if (count($fields)) {
+    foreach ($fields as $field_name => $item) {
+      $field_type = field_info_field_types($item['field']['type']);
+      if (!$field_type) {
+        drupal_set_message(t('Unknown field type %field_type. Field %field_name has not been created.', array(
+          '%field_type' => $item['field']['type'],
+          '%field_name' => $field_name,
+        )), 'error');
+        continue;
+      }
+      
+      $field = field_info_field($field_name);
+      if (!$field) {
+        field_create_field($item['field']);
+        drupal_set_message(t('Field %field has been created.', array('%field' => $field_name)));
+      }
+
+      $instance = field_info_instance($entity_type, $field_name, $bundle_name);      
+      if (!$instance) {
+        $item['instance']['bundle'] = $bundle_name;
+        $item['instance']['entity_type'] = $entity_type;
+        $item['field_id'] = $field['id'];
+        field_create_instance($item['instance']);
+        drupal_set_message(t('Field %field has been added to bundle %bundle.', array(
+          '%field' => $field_name,
+          '%bundle' => $bundle_name,
+        )));
+      }
+      else {
+        drupal_set_message(t('Field %field has not been added to bundle %bundle because the bundle already contains this field.', array(
+          '%field' => $field_name,
+          '%bundle' => $bundle_name,
+        )), 'error');
+      }
+      
+      
+    }
+  }
+}
+
+/**
+ * Import groups to a bundle
+ *
+ * @param array $fields 
+ *  As obtained from field_tools_get_field_code().
+ * @param string $bundle_name 
+ * @param string $entity_type 
+ * @return void
+ */
+function field_tools_import_groups($entity_type, $bundle_name, $groups) {
+  if (count($groups)) {
+    
+    if (!module_exists('field_group')) {
+      drupal_set_message(t('Groups could not be imported because the field_group module is not installed.'));
+      return;
+    }
+    
+    foreach ($groups as $group_name => $group) {
+      $existing_groups = field_group_read_groups(array('name' => $entity_type, 'bundle' => $bundle_name));
+      
+      if (isset($existing_groups[$entity_type][$bundle_name][$group->mode][$group_name])) {
+        drupal_set_message(t('Group %group has not been added to bundle %bundle because the bundle already contains this group.', array(
+          '%group' => $group_name,
+          '%bundle' => $bundle_name,
+        )), 'error');
+        continue;
+      }
+      
+      $group->identifier = $group->group_name . '|' . $entity_type . '|' . $bundle_name . '|' . $group->mode;
+      $group->bundle = $bundle_name;
+      $group->entity_type = $entity_type;
+      
+      if (isset($group->id)) {
+        unset($group->id);
+      }
+      if (isset($group->export_type)) {
+        unset($group->export_type);
+      }
+      ctools_export_crud_save('field_group', $group);
+      
+      drupal_set_message(t('Group %group has been added to bundle %bundle.', array(
+        '%group' => $group_name,
+        '%bundle' => $bundle_name,
+      )));
+    }
+  }
+}
+
+/**
  * Helper to get FormAPI options for entity bundles.
  *
  * @param string $current_entity_type
@@ -733,3 +1101,25 @@ function field_tools_field_instances_list($field) {
     'items' => $items_entities,
   ));
 }
+
+/**
+ * Build a Form API textarea array to use for import/export
+ *
+ * @param string $label 
+ * @param string $value 
+ * @return array
+ */
+function field_tools_textarea($label, $value = NULL) {
+  $textarea = array(
+    '#type' => 'textarea',
+    '#title' => $label,
+    '#rows' => 40,
+  );
+  if ($value === NULL) {
+    $textarea['#default_value'] = '';
+  }
+  else {
+    $textarea['#value'] = $value;
+  }
+  return $textarea;
+}
diff --git a/field_tools.module b/field_tools.module
index e08d5a0..c8ee63d 100644
--- a/field_tools.module
+++ b/field_tools.module
@@ -118,6 +118,47 @@ function field_tools_menu() {
             'file' => 'field_tools.admin.inc',
             'weight' => 10,
           ) + $access;
+          
+          // Menu items for import and export of fields
+          $items["$path/fields-export"] = array(
+            'title' => 'Export fields',
+            'page callback' => 'drupal_get_form',
+            'page arguments' => array('field_tools_bundle_export_form', $entity_type, $bundle_arg),
+            'type' => MENU_LOCAL_TASK,
+            'file' => 'field_tools.admin.inc',
+            'weight' => 15,
+          ) + $access;
+          
+          $items["$path/fields-import"] = array(
+            'title' => 'Import fields',
+            'page callback' => 'drupal_get_form',
+            'page arguments' => array('field_tools_bundle_import_form', $entity_type, $bundle_arg),
+            'type' => MENU_LOCAL_TASK,
+            'file' => 'field_tools.admin.inc',
+            'weight' => 20,
+          ) + $access;
+          
+          $items["$path/fields/%field_ui_menu/export"] = array(
+            'load arguments' => array($entity_type, $bundle_arg, $bundle_pos, '%map'),
+            'title' => 'Export',
+            'page callback' => 'drupal_get_form',
+            'page arguments' => array('field_tools_field_export_form', $field_position),
+            'type' => MENU_LOCAL_TASK,
+            'file' => 'field_tools.admin.inc',
+            'weight' => 1,
+          ) + $access;
+          
+          if (module_exists('field_group')) {
+            $items["$path/groups/%field_group_menu/export"] = array(
+              'load arguments' => array($entity_type, $bundle_arg, $bundle_pos, '%map'),
+              'title' => 'Export',
+              'page callback' => 'drupal_get_form',
+              'page arguments' => array('field_tools_group_export_form', $field_position),
+              'type' => MENU_CALLBACK,
+              'file' => 'field_tools.admin.inc',
+              'weight' => 1,
+            ) + $access;
+          }
         }
       }
     }
@@ -226,12 +267,87 @@ function _field_tools_field_already_attached($entity_type, $bundle_type, $field_
 }
 
 /**
- * Implements hook_form_FORM_ID_alter(): field_ui_field_overview_form
+ * Implements hook_form_alter().
+ */
+function field_tools_form_alter(&$form, $form_state, $form_id) {
+
+  if ($form_id == 'field_ui_field_overview_form') {
+    if (isset($form['#after_build']) && is_array($form['#after_build'])) {
+      $form['#after_build'][] = 'field_tools_alter_fields_ui_table';
+    }
+    else {
+      $form['#after_build'] = array('field_tools_alter_fields_ui_table');
+    }
+  }
+
+}
+
+/**
+ * Add an export link to the fields table of an entity.
  *
  * Add an extra column to Field UI admin forms to show the feature that a field
  * is exported to, if any.
+ *
+ * @param array $form 
+ * @param array $form_state 
+ * @return array
  */
-function field_tools_form_field_ui_field_overview_form_alter(&$form, &$form_state, $form_id) {
+function field_tools_alter_fields_ui_table($form, $form_state) {
+  
+  $form['fields']['#header'][6]['colspan']++;
+  foreach (element_children($form['fields']) as $field_name) {
+
+    if (!in_array($form['fields'][$field_name]['#row_type'], array('field', 'group'))) {
+      $form['fields'][$field_name]['export']['#markup'] = NULL;
+      continue;
+    }
+    
+    $bundle = $form['#bundle'];
+    $entity_type = $form['#entity_type'];
+    $admin_path = _field_ui_bundle_admin_path($entity_type, $bundle);
+
+    switch ($form['fields'][$field_name]['#row_type']) {
+      
+      case 'field':
+        
+        if (!isset($form['fields'][$field_name]['edit']) || (isset($form['fields'][$field_name]['edit']['#value']) && $form['fields'][$field_name]['edit']['#value'] == t('Locked'))) {
+          $form['fields'][$field_name]['export']['#markup'] = NULL;
+          continue;
+        }
+        
+        $instance = field_info_instance($entity_type, $field_name, $bundle);
+        $admin_field_path = $admin_path . '/fields/' . $instance['field_name'];
+
+        $form['fields'][$field_name]['export'] = array(
+          '#type' => 'link',
+          '#title' => t('export'),
+          '#href' => $admin_field_path . '/export',
+          '#options' => array(
+            'attributes' => array(
+              'title' => t('Export instance'),
+            )
+          ),
+        );
+        break;
+      
+      case 'group':
+        $admin_field_path = $admin_path . '/groups/' . $field_name;
+        $form['fields'][$field_name]['export'] = array(
+          '#type' => 'link',
+          '#title' => t('export'),
+          '#href' => $admin_field_path . '/export/form',
+          '#options' => array(
+            'attributes' => array(
+              'title' => t('Export group'),
+            )
+          ),
+        );
+        break;
+      
+    }
+    
+  }
+  
   if (module_exists('features')) {
     // Get the list of fields in features.
     $components_map = features_get_component_map('field');
@@ -278,4 +394,6 @@ function field_tools_form_field_ui_field_overview_form_alter(&$form, &$form_stat
     // Add the header for our column.
     $form['fields']['#header'][] = t('Feature');
   }
+  
+  return $form;
 }
