diff --git a/migrate_extras.snippets.inc b/migrate_extras.snippets.inc
new file mode 100644
index 0000000..990939b
--- /dev/null
+++ b/migrate_extras.snippets.inc
@@ -0,0 +1,224 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Useful functions you can use in your migrate module hook implementations.
+ */
+
+/**
+ * Prepares a semicolon-separated list of node titles, by mapping each title to
+ * a node ID, and producing an array ready to be used for a nodereference
+ * property of a node object.
+ *
+ * @param $titles
+ *   Semicolon-separated node titles in a string.
+ * @param $types
+ *   Node types that the node titles may be.
+ *
+ * @return
+ *   Nested array in the form:
+ *   array(
+ *     array(
+ *       'nid' => 123
+ *     ),
+ *     array(
+ *       'nid' => 456
+ *     )
+ *  )
+ */
+function migrate_extras_prepare_nodereferences($titles, $types = array()) {
+  $ret = array();
+
+  if (!empty($titles)) {
+    foreach (explode(';', $titles) as $title) {
+      if ($nid = migrate_extras_lookup_node_nid($title, $types)) {
+        $ret[]['nid'] = $nid;
+      }
+    }
+  }
+
+  return $ret;
+}
+
+/**
+ * Maps a node title to a node ID.
+ *
+ * @param $title
+ *   Node title.
+ * @param $types
+ *   Array of node types to search. Optional.
+ *
+ * @return
+ *   Node ID if found, otherwise NULL.
+ */
+function migrate_extras_lookup_node_nid($title, $types = array()) {
+  $args = array_merge($types, array($title));
+  if ($node = db_fetch_object(db_query("SELECT n.nid FROM {node} n WHERE" . (!empty($types) ? " n.type IN(" . db_placeholders($types, 'varchar') . ") AND" : '') . " n.title = '%s'", $args))) {
+    return $node->nid;
+  }
+}
+
+/**
+ * Maps a term name to a term ID.
+ *
+ * @param $name
+ *   Term name.
+ * @param $vids
+ *   Array of vocabularies to search. Optional.
+ *
+ * @return
+ *   Term ID if found, otherwise NULL.
+ */
+function migrate_extras_lookup_taxonomy_tid($name, $vids = array()) {
+  $args = array_merge($vids, array($name));
+  if ($term = db_fetch_object(db_query("SELECT t.tid FROM {term_data} t WHERE" . (!empty($vids) ? " t.vid IN(" . db_placeholders($vids) . ") AND" : '') . " t.name = '%s'", $args))) {
+    return $term->tid;
+  }
+}
+
+/**
+ * Prepares the array structure for a filefield CCK field.
+ *
+ * @param $image
+ *   File name (just the file, no directory path).
+ * @param $dest_dir
+ *   Path to the file, usually begins with 'sites/all/files'.
+ * @param $title
+ *   Alt and title text to save (if the file is an image).
+ *
+ * @return
+ *   CCK filefield array structure.
+ */
+function migrate_extras_prepare_filefield($image, $dest_dir, $title = '') {
+  static $extensions, $now;
+
+  if (!empty($image)) {
+    $filepath = $dest_dir . '/' . $image;
+
+    // Ensure the file exists.
+    if (file_exists(file_create_path($filepath))) {
+      // Check if the file exists in the 'files' table already.
+      $file = db_fetch_object(db_query("SELECT * FROM {files} WHERE filepath = '%s'", $filepath));
+
+      if (!isset($now)) {
+        $now = time();
+      }
+
+      // Create the file entry in the 'files' table if necessary.
+      if (!$file->fid) {
+        if (!isset($extensions)) {
+          $extensions = variable_get('upload_extensions_default', 'jpg jpeg gif png txt html doc xls pdf ppt pps odt ods odp');
+        }
+
+        $file = new stdClass;
+        $file->filepath = $filepath;
+        $file->filename = file_munge_filename(basename($file->filepath), $extensions);
+        $file->filemime = file_get_mimetype($file->filename);
+        $file->status = 1;
+        $file->timestamp = $now;
+        $file->filesize = filesize($file->filepath);
+        drupal_write_record('files', $file);
+      }
+
+      // Set up the image field.
+      return array(
+        'fid' => $file->fid,
+        'list' => 1,
+        'data' => array('alt' => $title, 'title' => $title, 'description' => $title),
+        'filename' => $file->filename,
+        'filepath' => $file->filepath,
+        'filemime' => $file->filemime,
+        'status' => 1,
+        'timestamp' => $now,
+      );
+    }
+  }
+}
+
+/**
+ * Adds a newly-imported file to the Drupal files table. This must be done
+ * as a post-processing job, separately to defining the CCK field structure,
+ * because we need the file ID which isn't available until here.
+ *
+ * @param $image
+ *   File name.
+ * @param $uid
+ *   User ID of the file owner.
+ * @param $dest_dir
+ *   Directory containing the file (usually begins with 'sites/all/files').
+ */
+function migrate_extras_complete_filefield($image, $uid, $dest_dir) {
+  if (!empty($image)) {
+    $filepath = $dest_dir . '/' . $image;
+
+    if (file_exists(file_create_path($filepath))) {
+      $file = db_fetch_object(db_query("SELECT * FROM {files} WHERE filepath = '%s'", $filepath));
+
+      if ($file->fid) {
+        $file->uid = $uid;
+        drupal_write_record('files', $file);
+      }
+    }
+  }
+}
+
+/**
+ * Copies the contents of one directory to another directory.
+ * Used to copy files into 'sites/all/files' for import.
+ * You can call this function as many times as you like, and it will only
+ * run the copy job once per src_dir and dest_dir combination.
+ *
+ * @param $src_dir
+ *   Source directory to copy from.
+ * @param $dest_dir
+ *   Destination directory to copy to.
+ * @param $force_run
+ *   Force the copy job to run, even if it's already run for this
+ *   src_dir and dest_dir combination. Optional (defaults to FALSE).
+ */
+function migrate_extras_copy_files($src_dir, $dest_dir, $force_run = FALSE) {
+  static $has_run = array();
+
+  if (empty($has_run[$src_dir][$dest_dir]) || $force_run) {
+    $images_import_path = './' . $src_dir;
+    $images_path = './' . $dest_dir;
+
+    $import_files = scandir($images_import_path);
+    unset($import_files[0]);
+    unset($import_files[1]);
+    if (!empty($import_files)) {
+      foreach ($import_files as $import_file) {
+        copy($images_import_path . '/' . $import_file, $images_path . '/' . $import_file);
+      }
+    }
+
+    $has_run[$src_dir][$dest_dir] = TRUE;
+  }
+}
+
+/**
+ * Generate a random character string.
+ * Copied from http://php.net/rand#90773
+ */
+function migrate_extras_rand_str($length = 32, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890') {
+  // Length of character list
+  $chars_length = (strlen($chars) - 1);
+
+  // Start our string
+  $string = $chars[rand(0, $chars_length)];
+
+  // Generate random string
+  for ($i = 1; $i < $length; $i = strlen($string)) {
+    // Grab a random character from our list
+    $r = $chars[rand(0, $chars_length)];
+
+    // Make sure the same two characters don't appear next to each other
+    if ($r != $string[$i - 1]) {
+      $string .=  $r;
+    }
+  }
+
+  // Return the string
+  return $string;
+}
