Import/Export NoSQL Data
Note
This feature is only available in NCache Enterprise Edition.
With NCache NoSQL database, you can backup in-memory data using any of the NoSQL database providers supported by NCache. Keeping in view the need to migrate data between different NoSQL databases, NCache allows you to import and export persisted data.
Export-NCacheNoSQLData
: exports persisted data to a JSON or CSV file.Import-NCacheNoSQLData
: imports data to a NoSQL database from a JSON or CSV file.
Note
Import-NCacheNoSQLData
and Export-NCacheNoSQLData
tools enable data migration for NoSQL databases. Meanwhile, data migration between local and clustered cache is not supported.
Using export and import together, you can easily migrate between different NoSQL databases or populate your NoSQL database before use. Here is how you can use the PowerShell tools provided by NCache to export data of a NoSQL store to a JSON/CSV file and then import it to your NoSQL database.
Note
Import/Export is not allowed on Local Cache.
Export NoSQL Data Using PowerShell
Note
The default file format for export is JSON.
Export-NCacheNoSQLData cmdlet enables you to export data persisted in NoSQL database to a JSON or CSV file. You can export data while cache is either running or stopped. The exported file has timestamp appended to the file name as cache_name-yyyyMMdd-HHmm and is created with .tmp extension. It is renamed to .json or .csv extension only when export is successfully completed.
Warning
Your store should not be empty while exporting data. If your store is empty, you will get an error that "There is no data in cache to export".
The following example exports all persisted data of cache named demoCache on server 20.200.21.11 to a new JSON file named demoCache-20220214-1127.json on the UNC path \\Fileserver\EXIM\.
Export-NCacheNoSQLData -CacheName demoCache -Server "20.200.21.11" -Format JSON -UNCPath "\\Fileserver\EXIM\"
Import NoSQL Data Using PowerShell
Import-NCacheNoSQLData cmdlet enables you to import data to your persistence store from a JSON or CSV file that is already created using NCache Export-NoSQLData
tool.
Warning
Before using Import-NoSQLData
tool, cache should be stopped.
The following example imports all data from a JSON file demoCache-20220214-1127.json existing on the UNC path \\Fileserver\EXIM\ to the persistence store of a cache named demoCache on server 20.200.21.11.
Important
Name of the file you want to import should be provided along with directory in -UNCPath
parameter.
Import-NCacheNoSQLData -CacheName demoCache -Server "20.200.21.11" -UNCPath "\\Fileserver\EXIM\demoCache-20220214-1127.json"
See Also
Create NoSQL Database
NoSQL Database Counters
NoSQL Database Settings