PreEmptive Analytics Standalone Repository User Guide

Data Management

Backup and migration

Backup of the Standalone Repository is handled through standard Mongo backup procedures. This guide details the preferred way to backup the data in order to maintain portability and minimize disk usage.

Setup

You may wish to put the mongodb\bin directory on the system path.

Export

  1. Open a Command Prompt
  2. Change to the output directory: cd <your_output_directory>
  3. Export the data with mongodump: mongodump -d PreEmptiveRepository -c Data
    • Note: this will export the data into a dump subdirectory, by default. You can override this with the -o argument

Import

  1. Open a Command Prompt
  2. Change to the directory with the exported data: cd <your_output_directory>
  3. Import the data with mongorestore: mongorestore
    • Note: if you changed the exported subdirectory's name from the default of dump, you should specify the new name as part of the command: mongorestore <new_name>.

It is safe to import into a Repository that already has data, as long as the source Repository and destination Repository have the same product version. Any matching records will be skipped, though an error message will be displayed for each.

Migration via database copy

Alternatively, the MongoDB files can be directly copied to a new destination. However, please note the following:

  • This will destroy any preexisting Standalone Repository data on the destination host.
  • During the migration, the Repository endpoint and any other PreEmptive Analytics products that use MongoDB on both hosts will be offline.

To copy the database:

  1. On both the source and destination host:
    1. Open the IIS Manager (from Run > inetmgr) and stop the PreEmptive Analytics Standalone Repository website.
    2. Open the Services control panel (Run > services.msc) and stop the MongoDB service.
  2. On the destination host, in the MongoDB data directory (default P:\data\db\), delete all files beginning with PreEmptiveRepository.
  3. Copy all the PreEmptiveRepository.* files from the source host's MongoDB data directory to the destination's MongoDB data directory.
    • The files will be numbered 0 through <n>, and there will also be a .ns file.
  4. On both the source and destination host:
    1. Open the Services control panel (Run > services.msc) and start the MongoDB service.
    2. Open the IIS Manager (from Run > inetmgr) and start the PreEmptive Analytics Standalone Repository website.

Note that this method may result in a larger dataset because the raw MongoDB files include pre-allocated space and detailed index data that isn't included in the export described above.

Purge

If you wish to empty your Standalone Repository database (e.g. for testing or system administration), follow this procedure:

  1. Open the IIS Manager (from Run > inetmgr) and stop the PreEmptive Analytics Standalone Repository website.
  2. From a command prompt, run c:\mongodb\bin\mongo PreEmptiveRepository --eval "db.dropDatabase()".
  3. Open the IIS Manager (from Run > inetmgr) and start the PreEmptive Analytics Standalone Repository website.

The Standalone Repository service will automatically recreate the database, and start storing any new data it receives.



Standalone Repository Version 1.2.0. Copyright © 2016 PreEmptive Solutions, LLC