
ShareGate stores its data in several key locations on your local machine. Understanding these locations is crucial for managing migration data effectively.
%LOCALAPPDATA%\Sharegate\userdata\migration\
Contains:
Contains session history and user mappings
%LOCALAPPDATA%\Sharegate\userdata\applogs\
Contains:
%LOCALAPPDATA%\Sharegate\userdata\cache\
β Safe to delete
Temporary files
%LOCALAPPDATA%\Sharegate\userdata\scheduling\
Scheduled migration definitions
%LOCALAPPDATA%\Sharegate\userdata\settings\
JSON Configuration Files:
%LOCALAPPDATA%\Sharegate\userdata\ββββ π migration\β βββ RecentSessionsInformation.sdb (100 KB - 1 MB)β βββ PrincipalMappings.sdb (10 - 100 KB)β βββ CustomFields.sdb (1 - 10 KB)β βββ NintexApiKey.sdb (1 - 10 KB)β βββ _Schema.sdb (Schema definitions)ββββ π applogs\ β οΈ LARGEST FILES = "Tasks" in UIβ βββ 10000001.sdb (1 MB - 10+ GB per file!)β βββ 10000002.sdb (Each is a migration task/session)β βββ 10000003.sdb (Contains ALL item details)β βββ ... (Numbers increment per session)ββββ π cache\ β SAFE TO DELETEβ βββ [Various temporary .sdb files]ββββ π scheduling\β βββ [Scheduled job definitions]ββββ π tables\βββ Reports.sdb (Report configurations)
ShareGate provides powerful PowerShell cmdlets for managing and exporting migration data. Here are the most important commands:
# Get ShareGate data location$shareGateData = "$env:LOCALAPPDATA\Sharegate\userdata"# List all .sdb files with sizesGet-ChildItem -Path $shareGateData -Filter "*.sdb" -Recurse |Select-Object FullName, @{N='Size(MB)';E={[Math]::Round($_.Length/1MB,2)}}, LastWriteTime |Sort-Object 'Size(MB)' -Descending
# Export each migration session to individual CSV filesImport-Module Sharegate$sessions = Find-CopySessionsWrite-Host "$($sessions.Count) sessions found" -ForegroundColor Greenmkdir "ShareGate Migration Logs" -ErrorAction SilentlyContinuePush-Location "ShareGate Migration Logs"for($o=0; $o -lt $sessions.count; $o++){$session = $sessions[$o]# Both .CSV and .XLSX are supported:Export-Report $session -NoItemVersions -DefaultColumns -Path ".\$($session.Id).csv"}Pop-Location
# Export logs when performance degrades, then delete old logs# Check total size first$appLogsPath = "$env:LOCALAPPDATA\Sharegate\userdata\applogs"$totalGB = (Get-ChildItem $appLogsPath -Filter "*.sdb" |Measure-Object Length -Sum).Sum / 1GBif ($totalGB -gt 10) {Write-Host "WARNING: Applogs size is $([Math]::Round($totalGB, 2)) GB" -ForegroundColor RedWrite-Host "Export your sessions with Export-Report, then delete old logs" -ForegroundColor Yellow# After exporting, delete large old filesGet-ChildItem $appLogsPath -Filter "*.sdb" |Where-Object { $_.Length -gt 1GB } |Sort-Object LastWriteTime |Select-Object -First 10 |Remove-Item -Force -WhatIf # Remove -WhatIf to actually delete}
When you click on a task in ShareGateβs Task History, the application needs to load and deserialize the entire .sdb file for that session. Larger files take significantly longer to load:
The applogs files (10000xxx.sdb) appear as βTasksβ in the ShareGate desktop application. Each task represents a migration session with detailed results:
ShareGate follows a specific data flow pattern for storing and retrieving migration data:
User β ShareGate UI β SnapDb Engine β Applogs Files (.sdb)β βMigration Complete PowerShell ExportβCSV/XLSX Report
%LOCALAPPDATA%\Apps\ShareGate\
%LOCALAPPDATA%\Sharegate\userdata\
Note: There are TWO distinct locations - Apps\ShareGate\
for executables and Sharegate\userdata\
for data.
While it is not possible to reuse ShareGateβs DLLs directly due to heavy obfuscation, Iβm documenting them here for scientific and educational purposes. Understanding the architecture helps migration specialists troubleshoot issues and optimize their workflows.
ShareGate stores various configuration settings in JSON format. These files control different aspects of the application:
{"theme": "light","maxConcurrentOperations": 4,"autoUpdate": true,"telemetryEnabled": true,"windowState": {"width": 1200,"height": 800,"maximized": false}}
{"defaultAuthMethod": "Modern","connectionTimeout": 30000,"useProxy": false,"validateCertificates": true,"retryAttempts": 3,"sslProtocol": "Tls12"}
{"defaultCopyOptions": {"preservePermissions": true,"preserveMetadata": true,"versionLimit": 10,"includeVersions": false,"preserveAuthors": true},"exportFormat": "xlsx","notificationSound": true}
{"recentSites": [{"url": "https://[tenant].sharepoint.com","title": "Contoso Portal","lastAccessed": "2024-01-15T10:30:00Z","isFavorite": true,"authType": "Modern"}],"maxRecentItems": 20}
Purpose: Quickly assess the health of your ShareGate installation by checking total data size and identifying old log files that may impact performance.
# ShareGate Health Check Scriptfunction Test-ShareGateHealth {$data = "$env:LOCALAPPDATA\Sharegate\userdata"# Check total size$totalGB = (Get-ChildItem $data -Recurse |Measure-Object Length -Sum).Sum / 1GB# Check old logs count$oldLogs = Get-ChildItem "$data\applogs" -Filter "*.sdb" |Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-90) }# Display health statusWrite-Host "`n=== ShareGate Health Status ===" -ForegroundColor Cyanif ($totalGB -lt 5) {Write-Host "β Size OK: $([Math]::Round($totalGB,1)) GB" -ForegroundColor Green} elseif ($totalGB -lt 10) {Write-Host "β Size Warning: $([Math]::Round($totalGB,1)) GB" -ForegroundColor Yellow} else {Write-Host "β Size Critical: $([Math]::Round($totalGB,1)) GB" -ForegroundColor Red}if ($oldLogs.Count -gt 0) {Write-Host "β Found $($oldLogs.Count) logs older than 90 days" -ForegroundColor Yellow} else {Write-Host "β No old logs found" -ForegroundColor Green}}Test-ShareGateHealth
Purpose: Create a backup of critical ShareGate data (migration history, scheduled jobs, and reports) while excluding temporary cache files.
# Backup ShareGate Data$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"$backupPath = "$env:USERPROFILE\Desktop\ShareGate-Backup-$timestamp"# Create backup directoryNew-Item -ItemType Directory -Path $backupPath -Force# Backup migration data (excluding cache)$source = "$env:LOCALAPPDATA\Sharegate\userdata"$folders = @('migration', 'scheduling', 'tables')foreach ($folder in $folders) {Copy-Item -Path "$source\$folder" -Destination $backupPath -RecurseWrite-Host "β Backed up: $folder" -ForegroundColor Green}Write-Host "`nβ Backup complete: $backupPath" -ForegroundColor Green
Purpose: Clean up cache and archive old applogs when ShareGate performance degrades. Only run this when you experience slow task loading times.
# Performance-Based Cleanup Script (Run ONLY when ShareGate is slow)$shareGateData = "$env:LOCALAPPDATA\Sharegate\userdata"# 1. Clear cacheRemove-Item "$shareGateData\cache\*" -Recurse -Force -ErrorAction SilentlyContinueWrite-Host "β Cache cleared" -ForegroundColor Green# 2. Archive old applogs (>90 days)$archivePath = "$env:USERPROFILE\Desktop\ShareGate-Archive-$(Get-Date -Format 'yyyyMM')"New-Item -ItemType Directory -Path $archivePath -Force$oldLogs = Get-ChildItem "$shareGateData\applogs" -Filter "*.sdb" |Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-90) }if ($oldLogs) {$oldLogs | Move-Item -Destination $archivePathWrite-Host "β Archived $($oldLogs.Count) old log files" -ForegroundColor Green}# 3. Display space recovered$newSize = (Get-ChildItem $shareGateData -Recurse |Measure-Object Length -Sum).Sum / 1GBWrite-Host "β Current size: $([Math]::Round($newSize, 2)) GB" -ForegroundColor Green
.SDB files are ShareGateβs proprietary storage format for Task History:
%LOCALAPPDATA%\Sharegate\userdata\applogs\
as numbered files (10000001.sdb, 10000002.sdb, etc.)Find-CopySessions
and Export-Report
cmdletsπ Full PowerShell Documentation β
This research provides a comprehensive understanding of ShareGateβs data storage architecture. The key findings reveal that ShareGate uses a custom NoSQL database (SnapDb) with serialized .NET objects rather than a traditional relational database. This architectural choice, while convenient for development, can lead to performance issues at scale.
For SharePoint Migration Specialists seeking to understand ShareGateβs inner workings.