NCache enables the user to create a backup of your cache data. Export-CacheData cmdlet creates a backup of all the items currently present in the cache to a network or local path provided by the user. Similarly, NCache provides an Import-CacheData cmdlet that enables the user to import the data placed at a specific path to your cache.
NOTE: You may be unable to run NCache PowerShell cmdlets if the environment variable PSModulePath has not been refreshed after the installation. Import the NCache PowerShell module (ncacheps.dll) found in the following location:
%NCHOME%\bin\tools\ncacheps
You can export the cache contents to any path specified by you along with the path of the dependent assemblies. The PowerShell cmdlet used for this purpose is:
Export-CacheData [-Name] [-NoLogo] [-Password] [-Path] [-Port] [-UserId]
The mandatory parameters of the command are explained below:
Example: The following command backs up all the items of the cache to the specified path:
Export-CacheData -Name demoCache -AssemblyPath C:\assembly-folder -Path C:\recovery-path
You can import data to the cache that resides on a specific path. The PowerShell cmdlet used for this purpose is:
Import-CacheData [-Name] [-AssemblyPath] [-BulkSize] [-ErrorThreshhold] [-Expiry] [-NoLogo] [-Password] [-Path] [-UserId]
The mandatory parameters of the command are explained below:
Example: This command imports the data from the backup source placed on the specified path to the cache including the dependent assembly files.
Import-CacheData -Name demoCache -AssemblyPath C:\assembly-folder -Path C:\recovery-path
For more detailed information please refer to the PowerShell Ref on our website.