Morpheus is a modern, open-source command-line interface (CLI) tool designed for managing database migrations in Neo4j graph databases. Currently at version 4.5.2, it follows a regular release cadence with several patch and minor updates typically occurring every few months, and major versions introducing significant architectural changes. Its core functionality involves executing pure Cypher queries from versioned `.cypher` files, ensuring a structured and reproducible migration process. Morpheus differentiates itself by providing a simple, intuitive, and CLI-centric workflow specifically tailored for Neo4j, taking inspiration from similar Java-based migration tools. It relies on environment variables or a configuration file (`morpheus.json`) for Neo4j connection details and does not provide traditional programmatic library imports as of version 4.0.0, shifting entirely to a CLI-first approach.
npm install morpheus4jVerified import paths — ran on the pinned version, not inferred.
Demonstrates global installation, setting up Neo4j connection via environment variables, initializing the configuration, creating a migration file, and finally running the migrations.
Users upgrading from v3.x must refactor their integration to use the `morpheus` CLI commands directly rather than programmatic imports. Consult the v4.0.0 release notes and documentation for new CLI flag syntax and usage.
Never modify existing migration files once they have been applied. If changes are needed, create a new migration file (`morpheus create new-changes`) to introduce the updates or rollbacks.
Carefully review your `.cypher` migration files and ensure each individual Cypher query ends with a semicolon.
Verify that your `morpheus.json` configuration or environment variables (MORPHEUS_HOST, MORPHEUS_PORT, MORPHEUS_SCHEME, MORPHEUS_USERNAME, MORPHEUS_PASSWORD, MORPHEUS_DATABASE) match your running Neo4j instance's settings. Ensure the Neo4j database is accessible from where Morpheus is being run.
For versions 4.0.0 and above, transition to using the `morpheus` command-line interface directly for all migration operations. If programmatic control is still required, consider externalizing CLI calls.
Upgrade your Node.js installation to version 18.0.0 or higher. Use a version manager like `nvm` (Node Version Manager) for easy switching (e.g., `nvm install 18 && nvm use 18`).
Do not modify migration files after they have been executed. If you need to make changes, create a new migration file (`morpheus create new-feature`) that contains the necessary updates or corrections.
Verify your Neo4j connection settings in `morpheus.json` or via environment variables (e.g., `MORPHEUS_HOST`, `MORPHEUS_PORT`, `MORPHEUS_USERNAME`, `MORPHEUS_PASSWORD`). Ensure your Neo4j database is running and accessible from the machine executing Morpheus.
Review the indicated line and column in your `.cypher` migration file and add a semicolon (`;`) at the end of each distinct Cypher statement.