Release Date: 06/12/2025
Version: N/A
In the older Windows operating systems, like Windows 2008 or 2012, we often use the Windows command prompt to COPY and XCOPY for backup and creating/ testing Elliott database purposes. We can do so even though some of the Elliott database files are still opened by the PSQL (ZEN) database engine.
Starting with Windows 2016, 2019, and beyond, you may experience a "sharing violation" when trying to copy those open files. This is a common limitation with file copying on shared volumes or mapped drives with a newer Windows OS. These versions have stricter file locking, security policies, and improved concurrency management, which can prevent you from copying files that are in use or opened by others.
To overcome this issue effectively. You can use the Windows Shadow Copy (VSS) to Copy In-Use Files.
Step 1 - You must make sure you are an Administrator or an Administrator-equivalent user on the server where the files reside.
Step 2 - Bring up a CMD prompt, and type DISKSHADOW. The User Security Elevation window may show up and you need to confirm "Yes" to allow DiskShadow app to proceed.
Step 3 - The DiskShadow shell window will show up. Please type the following in the shell:
SET CONTEXT PERSISTENT NOWRITERS
ADD VOLUME D: ALIAS MyShadow
CREATE
EXPOSE %MyShadow% X:
- Note the D: is the volume on the server you want to copy from to create the Shadow Copy.
- You cannot use a mapped drive letter or UNC path to create the Shadow Copy.
- The CREATE step can take a significant amount of time (minutes) depending on the size of your volume.
See sample screen below:
Step 4 - Bring up another CMD prompt to run in "Administrator" mode. Use COPY, XCOPY to copy from the X: drive instead of D: drive to the destination.
Step 5 - After successfully copying the files, in the DiskShadow shell, type the following command:
DELETE SHADOWS ALL
Clean up
Please be aware of the following:
- You must manually delete the shadow copy to ensure it's properly removed and system resources are freed.
- If you just exit DiskShadow, it does not delete persistent shadow copies.
EMK