Export/Import-Configuration
The Export-Configuration and Import-Configuration PowerShell cmdlets enable you to transfer NCache configurations between servers. You can export cache, security, NCache service, TLS, and bridge configurations from one server and import them to another. Cache configurations can also include deployed server-side modules, allowing the cache and its associated components to be transferred together.
Important
The cache name must be the same while using the Export-Configuration and Import-Configuration cmdlets.
Export-Configuration
The Export-Configuration cmdlet exports the specified configuration type from an NCache server. Depending on the selected type, it can export cache configurations and deployed server-side modules, node security settings, NCache service settings, TLS configurations, or bridge configurations.
The exported configuration is saved to an ncexport-<server> folder within the specified path. When exporting a single cache or bridge, the folder is named ncexport-<server>-<name>.
- This command exports the complete configuration of the server 20.200.20.11 into the
ncexport-20.200.20.11folder created within the specified directory.
Export-Configuration -Type All -Server 20.200.20.11 `
-Path C:\Desktop\config
- This command exports the configuration of defaultCache along with its deployed server-side modules into the
ncexport-20.200.20.11-defaultCachefolder created within the specified directory.
Export-Configuration -Type Cache -Name defaultCache `
-Server 20.200.20.11 -Path C:\Desktop\config
- This command exports only the configuration of defaultCache without its deployed server-side modules.
Export-Configuration -Type Cache -Name defaultCache `
-Server 20.200.20.11 -Path C:\Desktop\config `
-DoNotExportModules
- This command exports the node security configuration of the server listening at the specified port.
Export-Configuration -Type Security -Server 20.200.20.11 `
-Port 9802 -Path C:\Desktop\config
- This command exports all NCache configurations from the specified server with mutual TLS (mTLS) enabled to
C:\Desktop\config. It runs from a machine where NCache is not installed and usesC:\certs\client.pemto authenticate the machine running the cmdlet. The-TlsCertPasswordparameter decrypts the certificate’s password-protected private key. Omit this parameter if the private key is not encrypted.
Export-Configuration -Type All -Server 20.200.20.11 `
-Path C:\Desktop\config -TlsCertPath "C:\certs\client.pem" `
-TlsCertPassword "clientKeyPassword"
- This command exports the complete configuration of the server 20.200.20.11 into the
ncexport-20.200.20.11folder created within the specified directory, using security credentials.
Export-Configuration -Type All -Server 20.200.20.11 `
-Path C:\Desktop\config -Credentials(Get-Credential john_smith)
For more information on the command parameters, please see PowerShell Reference.
Import-Configuration
The Import-Configuration cmdlet applies configurations previously exported using Export-Configuration to an NCache server. Depending on the specified configuration type, it can register exported caches along with their deployed server-side modules and apply node security, NCache service, TLS, or bridge configurations.
The specified path must point to the export folder generated by the Export-Configuration cmdlet.
- This command imports the complete configuration exported from the server 20.200.20.11 on the server 20.200.20.12.
Import-Configuration -Type All -Server 20.200.20.12 `
-Path C:\Desktop\config\ncexport-20.200.20.11
- This command registers defaultCache along with its deployed server-side modules on the server 20.200.20.12.
Import-Configuration -Type Cache -Name defaultCache `
-Server 20.200.20.12 -Path C:\Desktop\config\ncexport-20.200.20.11-defaultCache
- This command registers defaultCache on the server 20.200.20.12 without deploying the server-side modules exported with it.
Import-Configuration -Type Cache -Name defaultCache `
-Server 20.200.20.12 -Path C:\Desktop\config\ncexport-20.200.20.11-defaultCache `
-DoNotImportModules
- This command imports all NCache configurations from
C:\Desktop\config\ncexport-20.200.20.11into the specified server with mutual TLS (mTLS) enabled. It runs from a machine where NCache is not installed and uses C:\certs\client.pem to authenticate the machine running the cmdlet. The-TlsCertPasswordparameter decrypts the certificate’s password-protected private key. Omit this parameter if the private key is not encrypted.
Import-Configuration -Type All -Server 20.200.20.12 `
-Path C:\Desktop\config\ncexport-20.200.20.11 -TlsCertPath "C:\certs\client.pem" `
-TlsCertPassword "clientKeyPassword"
- This command applies the exported TLS configuration on the server listening at the specified port.
Import-Configuration -Type TLS -Server 20.200.20.12 `
-Port 9802 -Path `C:\Desktop\config\ncexport-20.200.20.11
For more information on the command parameters, please see PowerShell Reference.
See Also
Start Cache
Restart Cache
Manage Cache Service on a Server Node