File Migration Validation Tool User Guide

The Script can be found at this location - ICT Documents - Post Migration File checker tool - All Documents 

Overview

The File Migration Validation Tool is a PowerShell script designed to verify the integrity of files after they've been migrated from one location to another. It helps you ensure that all your files have been transferred correctly by comparing files in the source and destination folders.

What This Tool Does

  • Scans source and destination folders for all files
  • Compares files using their content (file hash), size, and timestamps
  • Identifies missing files (files in source but not in destination)
  • Identifies mismatched files (files with different content)
  • Creates a detailed Excel report of the validation results
  • Uses multi-threading for faster processing of large file collections

Before You Begin

Requirements

  • Windows operating system
  • PowerShell 5.1 or higher
  • Microsoft Excel (for report generation)
  • Administrator privileges may be needed depending on the folders you're accessing

Preparation

  1. Have your source and destination folder paths ready
  2. Make sure you have access permissions to both locations
  3. Know how many CPU cores your computer has (for optimal thread settings)

Running the Tool

Step 1: Start the Script

  1. Open PowerShell (you can search for "PowerShell" in the Start menu)
  2. Navigate to the folder containing the script
  3. Run the script by typing:
    .\MigrationValidationTool.ps1
    

Step 2: Enter Source and Destination Folders

When prompted:

  • Enter the full path to your source folder (where files were originally stored)
  • Enter the full path to your destination folder (where files were copied to)

Example:

Enter the path to the source folder: C:\OriginalData Enter the path to the destination folder: D:\BackupData

Step 3: Select Path Mapping Option

The script will ask how to map paths between source and destination:

  1. Option 1: Use relative paths (Recommended for simple migrations)

    • Choose this if your folder structure is identical between source and destination
    • Example: If both locations have the same subfolders like "\Documents\Reports"
  2. Option 2: Custom root paths (For complex migrations)

    • Choose this if the folder structures differ but contain the same files
    • You'll need to specify the root paths to be replaced
    • Example: Mapping "E:\Company_Data\Djarragun Enterprises\ZZ. 2. Finance" to "G:\OneDrive\Bama Services\Finance Documents - Documents\2. Finance"

Step 4: Set Thread Count

Enter the number of parallel processes to use:

  • Recommended: Use the number of CPU cores in your computer
  • Default: 4 threads
  • Higher values may speed up processing but will use more system resources
  • If unsure, press Enter to use the default

Step 5: Choose Report Output Location

Specify where to save the validation reports:

  • Enter a folder path, or
  • Press Enter to use the current directory

Step 6: Wait for Processing

The script will now:

  1. Scan all files in both locations
  2. Calculate file hashes (this is the most time-consuming part)
  3. Compare files between locations
  4. Generate a report

You'll see progress bars showing:

  • Overall progress through the validation steps
  • Current file processing progress
  • Estimated time remaining

Understanding the Results

On-Screen Summary

After processing completes, you'll see a summary showing:

  • Total files in source and destination
  • Number of missing files
  • Number of mismatched files
  • Number of successfully matched files
  • Processing times

Excel Report

An Excel file will be created containing detailed results with four worksheets:

  1. Summary - Overview of the validation results

    • Source and destination folder information
    • Count of matched, mismatched, and missing files
    • Processing statistics
  2. Matched Files - Files that transferred correctly

    • List of all successfully matched files
    • File paths, sizes, hashes, and timestamps
  3. Mismatched Files - Files with content differences

    • Files that exist in both locations but have different content
    • Color-coded indicators show which attributes don't match (size, hash, time)
  4. Missing Files - Files not found in destination

    • Files that exist in the source but are missing from the destination
    • Details of the source files for reference

Common Issues and Solutions

"Error: Source/Destination folder does not exist or is not accessible"

  • Check that the path is typed correctly
  • Verify you have permission to access the folder
  • Try using full path names (e.g., "C:\Users\YourName\Documents" instead of relative paths)

"Could not create Excel report"

  • Make sure Microsoft Excel is installed
  • Check if you have permission to write to the output folder
  • Try running PowerShell as Administrator
  • Note: Even if the Excel report fails, the validation process itself is still complete

Slow Processing Times

  • Try increasing the thread count
  • Close other applications to free up system resources
  • For very large file collections, consider running the script overnight

Advanced Tips

For Large File Collections

  • Run the script when the computer isn't being used for other tasks
  • Consider validating subsets of your data by running the script on specific subfolders

Custom Path Mapping

When using Option 2 (custom root paths), provide the exact portion of the path that differs between source and destination. This helps the script correctly match files that are in different folder structures.

Analyzing Results

  • Focus first on missing files - these need to be migrated again
  • For mismatched files, check if the difference is important (sometimes timestamps are intentionally different)
  • Use the Excel report to sort and filter results for easier analysis

Report Output Location

The reports are saved to:

  • The location you specified during setup, or
  • The current directory (if no location was specified)

The report folder is named "MigrationValidation_[DATETIME]" where [DATETIME] is the current date and time.