diff -u b/cck.install b/cck.install
--- b/cck.install
+++ b/cck.install
@@ -99,7 +99,6 @@
 
   // Query the existing D6 files table for possible duplicate URIs in D7.
   if (db_table_exists('files')) {
-
     if (!isset($sandbox['progress'])) {
       $sandbox['progress'] = 0;
       $sandbox['current_file'] = '';
@@ -107,34 +106,13 @@
     }
 
     // Update 50 files at a time.
+    $batch_size = 50;
     $query = "SELECT f1.fid, f1.filename, f1.filepath FROM {files} f1 WHERE (SELECT count(f2.filepath) FROM {files} f2 WHERE f2.filepath = f1.filepath) > 1 ORDER BY f1.filename";
-    $result = db_query_range($query, $sandbox['current_file'], 5);
+    $result = db_query_range($query, $sandbox['current_file'], $batch_size);
     $last_file = '';
-    $current_file = '';
-    $batch_size = 5;
-
-/*
-    // SELECT count(f2.filepath) FROM {files} f2 WHERE f2.filepath = f1.filepath
-    $sub_query = db_select('files', 'f2');
-    $sub_query->addExpression('COUNT(f2.filepath)');
-    $sub_query->condition('f2.filepath', 'f1.filepath', '=');
-    $sub_query->execute()->fetchField();
-
-    // SELECT f1.fid, f1.filename, f1.filepath FROM {files} f1 WHERE (sub_query) > 1 ORDER BY f1.filename
-    $query = db_select('files', 'f1');
-    $query->addField('f1', 'fid');
-    $query->addField('f1', 'filename');
-    $query->addField('f1', 'filepath');
-    $query->condition($sub_query, '1', '>');
-    $query->range(0, $batch_size);
-    $query->orderBy('f1.filename', 'ASC');
-    $result = $query->execute();
-*/
 
     foreach ($result as $record) {
-      $current_file = strtolower($record->filepath);
-
-      if ($current_file == $last_file) {
+      if ($record->filepath == $last_file) {
         // Log an error if the file copy destination is not writable.
         $directory = str_replace('/' . $old_file, '', $record->filepath);
         if (!file_prepare_directory($directory, FILE_CREATE_DIRECTORY)) {
@@ -148,35 +126,32 @@
             watchdog('cck', 'The file could not be copied, because the destination %destination is invalid.', array('%destination' => $destination), 'error');
           }
           else {
-            $files_dir = variable_get('file_directory_path', 'files') . '/';
-            $path_without_files = strtolower(str_replace($files_dir, '', $record->filepath));
-            // Get the new file location and copy the file.
-            $new_uri = file_destination($destination . $path_without_files, FILE_EXISTS_RENAME);
-            $new_filename = array_pop(explode('/', $new_uri));
-            $new_filepath = $files_dir . str_replace($destination, '', $new_uri);
-            // Copy the file on disk.  Leaving the original file in place means embeded links will still work.
-            if (!copy($record->filepath, $new_filepath)) { 
-              watchdog('cck', t('Unable to safely copy file from !old to !new', array('!old' => $record->filepath, '!new' => $new_filepath)), 'error');
-            }
+            // Duplicate file via copy.
+            $new_path = str_replace("public://", "", file_destination($destination . $record->filepath, FILE_EXISTS_RENAME));
+            $saved_filepath = file_unmanaged_copy($record->filepath, $new_path, FILE_EXISTS_RENAME);
+
             // Update the database to use the new filename.
-            $num_updated = db_update('files') 
-              ->fields(array(
-                'filename' => $new_filename,
-                'filepath' => $new_filepath,
-              ))
-              ->condition('fid', $record->fid, '=')
-              ->execute();
-            drupal_set_message('Updated file: ' . $record->fid);
+            if ($saved_filepath) {
+              $saved_filepath_base = basename($saved_filepath);
+              $num_updated = db_update('files')
+                ->fields(array(
+                  'filename' => $saved_filepath_base,
+                  'filepath' => $saved_filepath,
+                ))
+                ->condition('fid', $record->fid, '=')
+                ->execute();
+              drupal_set_message("Updated file: fid: $record->fid, $record->filename to $saved_filepath_base");
+            }
           }
         }
       }
       $last_file = strtolower($record->filepath);
 
-      $sandbox['progress']++;
-      $sandbox['current_file'] = $current_file;
+      $sandbox['current_file'] = $record->filepath;
     }
 
-    $ret['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);
+    $sandbox['progress']++;
+    $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);
   }
 
   return $ret;
