diff --git amazon.install amazon.install
index d0f4592..8d8b28a 100644
--- amazon.install
+++ amazon.install
@@ -130,9 +130,39 @@ function amazon_schema() {
   return $schema;
 }
 
+/**
+ * Update variables from legacy AAT module where possible. Add mpn field.
+ */
 function amazon_update_6001() {
   $ret = array();
   db_add_column($ret, 'amazon_item', 'mpn', 'varchar(128)');
+
+  // If the access key is not set, and there is a D5 amazontools access key, use it.
+  $d6_aws_access_key = variable_get('amazon_aws_access_key', "");
+  if (empty($d6_aws_access_key)) {
+    $old_access_key = variable_get('amazon_awsaccess_key', "");
+    if (!empty($old_access_key)) {
+      variable_set('amazon_aws_access_key', $old_access_key);
+      variable_del('amazon_awsaccess_key');
+      $ret[] = array('success' => TRUE, 'query' => 'Updated Amazon AWS Access Key from D5 AAT');
+    }
+  }
+  // Bring over the d5 associate id if possible.
+  $d6_associate_id = variable_get("amazon_custom_associate_id", "");
+  if (empty($d6_associate_id)) {
+    $associate_id = variable_get("amazon_associate_id", "");
+    if (!empty($associate_id)) {
+      variable_set('amazon_custom_associate_id', $associate_id);
+      variable_set('amazon_associate_setting', 'custom');
+      variable_del("amazon_associate_id");
+      $ret[] = array('success' => TRUE, 'query' => 'Updated Amazon Associate ID from D5 AAT');
+    }
+  }
+  if (is_numeric(variable_get('amazon_locale',"US"))) {
+    variable_del('amazon_locale');
+    drupal_set_message(t("The Amazon locale setting was invalid. Please visit the <a href='!url'>Amazon settings page</a> to correct it.", array('!url' => url('admin/settings/amazon'))));
+  }
+
   return $ret;
 }
 
diff --git asin/asin.install asin/asin.install
index f4696c6..dd361ce 100644
--- asin/asin.install
+++ asin/asin.install
@@ -45,6 +45,12 @@ function asin_update_6001() {
     return $abort;
   }
 
+  // The name of the widget type has changed from asin to asin_text.
+  $ret[] = update_sql("UPDATE {" . content_instance_tablename() . "} SET widget_type = 'asin_text' WHERE widget_type = 'asin'");
+  // All CCK fields are disabled by Content module during the D6 upgrade.
+  // Re-enable the 'asin' field.
+  content_associate_fields('asin');
+
   // Build a list of fields that need data updating.
   module_load_install('content');
   module_load_include('inc', 'content', 'includes/content.admin');
@@ -54,14 +60,14 @@ function asin_update_6001() {
   $fields = array();
 
   content_clear_type_cache(TRUE);
- 
+
   // Grab the list of fields to update.
-  foreach (content_field_instance_read() as $field) {
-    if ($field['type'] == 'asin' && $field['widget']['type'] == 'asin') {
+  foreach (content_field_instance_read(NULL, TRUE) as $field) {
+    if ($field['type'] == 'asin' && $field['widget']['type'] == 'asin_text') {
       $fields[] = $field;
     }
   }
-  
+
   content_clear_type_cache(TRUE);
 
   // Update database storage (add data column, since the D5 version assumed all control).
@@ -79,7 +85,7 @@ function asin_update_6001() {
 
     $ret[] = array('success' => TRUE, 'query' => 'Updated database schema and widget settings for ' . $field['field_name']);
   }
-  
+
   content_clear_type_cache(TRUE);
 
   return $ret;
