Troubleshooting Guide: Error 12619 – Database Clone Creation Fails Due to Long File Path
Why This Error Happens
Error 12619 occurs when the fully qualified file path for the database clone (data/log files) exceeds the maximum path length limit recognized by SQL Server’s DBCC CLONEDATABASE operation. This typically happens when the source database is nested deep within directory structures, or when auto-generated clone file names combined with timestamps push the total character count past the 260-character (MAX_PATH) threshold. It can also occur if the default data directory configured in SQL Server points to a long UNC path rather than a shorter local or mapped path.
Step-by-Step Resolution Guide
Step 1: Verify the Current File Path Length
- Open SQL Server Management Studio (SSMS) and run the following query to check default data/log paths:
EXEC master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultData';- Count the total character length including the database name, clone suffix, and
.mdf/.ldfextensions — anything over 260 characters will trigger Error 12619.
Step 2: Relocate the Default Data and Log Directories
- Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
- Navigate to SQL Server Services → right-click your instance → Properties → Startup Parameters.
- Change the default data path to a shorter root-level directory, such as
D:\SQLData\instead of a deeply nested path likeD:\Departments\Finance\Databases\2025\Archive\SQLData\. - Restart the SQL Server service for changes to take effect:
net stop MSSQLSERVER && net start MSSQLSERVER
Step 3: Enable Long Path Support in Windows
- Open Group Policy Editor (
gpedit.msc) on Windows Server 2025 or Windows 11. - Navigate to Computer Configuration → Administrative Templates → System → Filesystem.
- Enable “Enable Win32 long paths” and apply the policy.
- Alternatively, set the registry key directly:
reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1- Restart the server to apply filesystem-level changes.
Step 4: Manually Specify Shorter Clone File Paths
- When running
DBCC CLONEDATABASE, explicitly define shorter output paths instead of relying on SQL Server’s default naming convention: DBCC CLONEDATABASE ('SourceDB', 'ClonedDB') WITH BACKUP_FILES, NO_STATISTICS;- Pre-create a short-path directory (e.g.,
C:\Clones\) dedicated solely to clone operations to avoid path inheritance issues from nested source folders.
Alternative or Verification Steps
- Re-run
DBCC CLONEDATABASEafter applying the above changes and confirm the clone completes without Error 12619; checksys.databasesto verify the cloned database is listed and accessible. - If the error persists, use PowerShell to symlink a shortened path (
New-Item -ItemType SymbolicLink) pointing to the deep directory structure, effectively reducing the character count SQL Server evaluates during path validation.