Export and Import

Nymph provides a method for exporting and importing its entities and UIDs, regardless of which driver is currently in use. This allows backup, restore, duplication, or transferring an entire database, even with different database drivers.

Nymph has the following methods for exporting and importing entities.

  • export - Export entities to a file.
  • exportPrint - Export entities to the console.
  • import - Import entities from a file.
// Export entities to a file.

// Export entities to the console.

// Import entities from a file.

The format of a Nymph export file is simple, and readable by all drivers. The file extension, nex, stands for Nymph Entity eXchange.

# The above line must be the first thing in the file.
# Comments begin with #
   # And can have white space before them.
# This defines a UID.
<another uid>[8000]
# For UIDs, the name is in angle brackets (<>) and the value follows
# in square brackets ([]).
# This starts a new entity.
# For entities, the GUID is in curly brackets ({}), then the etype in
#  angle brackets, then the comma separated tag list follows in square
#  brackets ([]).
# Properties are stored like this:
# propname=JSON.stringify(value)
# White space before/after "=" and at beginning/end of line is ignored.
        username  =     "admin"
    another="This is another entity."
Previous: Transactions