7 Exporting and Importing Entities
Hunter Perrin edited this page 2018-05-07 19:12:45 -07:00

Nymph provides a method for exporting and importing entities, regardless of which driver is currently in use. This allows backup, restore, duplication, or transferring an entire database of entities, 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 client as a downloadable file.
  • import - Import entities from a file.
Exporting and Importing Entities
// Make sure the script doesn't terminate
// before the entities are exported/imported.
@set_time_limit(3600);

use Nymph\Nymph as Nymph;

// Export entities to a file.
Nymph::export($filename);

// Export entities to the client.
Nymph::exportPrint();

// Import entities from a file.
Nymph::import($filename);

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