Purge Missing Files Utility
Overview
The Purge Missing Files utility helps maintain database integrity by identifying and removing entries for
files that no longer exist on your storage devices.
This utility is especially useful when you've moved, deleted, or reorganized your photos, ensuring your
database only references files that are actually available.
When to Use
The Purge utility should be used in these situations:
After Moving or Reorganizing Photos
If you've relocated your photo library or changed your folder structure, some photo paths may no longer be
valid.
After Deleting Photos
When you've deleted photos but their entries remain in the Tag-AI database.
When Storage Media Changes
If you've moved photos to a different drive, external storage, or new computer.
When Search Shows Missing Files
If search results include photos that can't be displayed because they no longer exist at the recorded path.
Regular Maintenance
As part of regular database maintenance, particularly for large libraries.
It's recommended to run the Purge utility periodically (every few months) if you actively manage your
photo collection outside of Tag-AI.
Accessing the Purge Utility
To open the Purge utility:
- In the Tag-AI main window, click on Actions in the menu bar
- Select Purge from the dropdown menu
- The Purge Missing Files window will open
Using the Purge Utility
Scanning for Missing Files
- Click the Scan button to begin checking all file paths in the database
- The utility will verify each file's existence on disk
- Progress will be displayed in the status bar
- When complete, a list of missing files will be displayed
Processing Missing Files
For each missing file, you have several options:
Individual Processing
- Remove: Delete the database entry for the current file
- Skip: Keep the database entry and move to the next file
Batch Processing
- Remove All: Delete database entries for all missing files
- Skip All: Keep all database entries and exit the process
Understanding Results
Missing File Types
Files may be missing for various reasons:
- File Deletion: The file has been permanently deleted
- Path Change: The file exists but in a different location
- Storage Availability: An external drive or network location is disconnected
- Permission Issues: Tag-AI can't access the file due to permission changes
Removal Impact
When you remove a missing file entry:
- The file's record is deleted from the
photos
table
- All associated tag relationships are removed from
photo_tags
- The tags themselves remain in the
tags
table for use with other photos
- If the file is later rescanned, it will be treated as a new file
Batch Processing
When to Use Remove All
The "Remove All" option is best when:
- You're certain all listed files are permanently gone
- You've intentionally deleted the files
- You want to clean up your database in a single operation
When to Use Skip All
The "Skip All" option is best when:
- You plan to reconnect the storage where files are located
- You'll be restoring the files from backup
- The missing files are temporarily inaccessible
The "Remove All" action cannot be undone. If you're unsure, process files individually or back up your
database first.
Important Considerations
External and Network Drives
Before running the Purge utility:
- Ensure all external drives containing photos are connected
- Verify network drives are mounted and accessible
- Check that cloud storage sync is complete if using synced folders
Database Backup
It's recommended to back up your database before performing a large purge operation.
Performance Impact
For large libraries:
- Scanning can take time as each file path must be checked
- Processing occurs in parallel for better performance
- The utility prioritizes accuracy over speed
Troubleshooting
Purge Utility Not Finding Missing Files
If the utility reports no missing files but you know some should be missing:
- Verify the files are actually missing by checking their paths
- Check if symbolic links or shortcuts might be redirecting to valid locations
- Ensure you have appropriate permissions to access the file locations
Files Still Appearing After Purge
If purged files still appear in search results:
- Restart Tag-AI to ensure all caches are cleared
- Verify the correct files were selected for removal
- Check if there are duplicate entries with different paths
Utility Performance Issues
If the utility is running very slowly:
- Ensure network drives have good connectivity
- Close other applications to free up system resources
- Consider running the utility during off-hours for large libraries
Database Errors During Purge
If database errors occur during the purge operation:
- Check if the database is locked by another process
- Restart Tag-AI and try again
- If errors persist, consider repairing the database (see Database Management)