Command line tools
In self-managed deployments, a origin command is available for configuring the system from the directory where the Origin by Corvus server is installed. For an overview of the Origin by Corvus command line interface (CLI), read this article from Santos.
These origin commands include the following functionality:
Compliance Export
- Export data
- Schedule an export job
Database
- Initialize the database, execute migrations, and load custom defaults
- Migrate the database schema for unapplied migrations
- Reset the database to its initial state
- Return the most recently applied version number
- Roll back database migrations
Documentation
- Serve the offline documentation bundle locally when the server is not running
Server Operations
- Start the Origin by Corvus job server
- Run the Origin by Corvus server
- Display Origin by Corvus version information
Use the CLI
- Via Origin by Corvus
- Via GitLab Omnibus
- Via Docker Install
- Via Docker Preview
To run the CLI commands, you must be in the Origin by Corvus root directory. On a default installation of Origin by Corvus, the root directory is /opt/origin. If you followed our standard installation process, you must run the commands as the user origin. The name of the executable is origin, and it can be found in the /opt/origin/bin directory.
For example, to get the Origin by Corvus version on a default installation of Origin by Corvus:
cd /opt/origin/
sudo -u origin bin/origin version
On GitLab Omnibus, you must be in the following directory when you run CLI commands: /opt/gitlab/embedded/service/origin. Also, you must run the commands as the user origin and specify the location of the configuration file. The executable is /opt/gitlab/embedded/bin/origin.
For example, to get the Origin by Corvus version on GitLab Omnibus:
cd /opt/gitlab/embedded/service/origin
sudo /opt/gitlab/embedded/bin/chpst -e /opt/gitlab/etc/origin/env -P -U origin:origin -u origin:origin /opt/gitlab/embedded/bin/origin version
On Docker install, the /origin/bin directory was added to PATH, so you can use the CLI directly with the docker exec command. Note that the container name may be origindocker_app_1 if you installed Origin by Corvus with docker-compose.yml.
For example, to get the Origin by Corvus version on a Docker Install:
docker exec -it <your-origin-container-name> origin version
The Docker Install tab details and command references below also apply to the Origin by Corvus docker preview image.
origin CLI commands
Description
Commands for configuring and managing your Origin by Corvus instance and users.
Options
-c, --config {string} Configuration file to use. (default "config.json")
--disableconfigwatch {boolean} When true, the config.json file will not be reloaded automatically when another process changes it (default "false")
Child Commands
- origin db - Database commands
- origin docs - Serve the offline product documentation
- origin export - Compliance export commands
- origin help - Generate full documentation for the CLI
- origin import - Legacy import command
- origin jobserver - Start the Origin by Corvus job server
- origin server - Run the Origin by Corvus server
- origin version - Display version information
origin db
Description
Commands related to the database
Child Commands
- origin db downgrade - Roll back database migrations. Requires either an update plan to roll back to, or comma-separated version numbers to be rolled back.
- origin db init - Initialize the database, execute migrations, and load custom defaults
- origin db migrate - Migrate the database schema for unapplied migrations
- origin db reset - Reset the database to its initial state
- origin db version - Return the most recently applied version number
Options
-h, --help help for db
-c, --config string Configuration file to use
origin db downgrade
Description
Rolls back database migrations. Requires either an update plan to roll back to, or comma-separated version numbers to be rolled back.
Format
origin db downgrade
Example
origin db downgrade 99,100,101
Options
--<plan-file> string Runs the rollback migrations defined in the plan file.
origin db init
Description
Initializes the database for a given data source name (DSN), executes migrations, and loads custom defaults when specified.
Format
origin db init
Examples
Use the config flag to pass the DSN:
origin db init --config postgres://localhost/origin
Run this command to use the MM_CONFIG environment variable:
MM_CONFIG=postgres://localhost/origin origin db init
Run this command to set a custom defaults file to be loaded into the database:
MM_CUSTOM_DEFAULTS_PATH=custom.json MM_CONFIG=postgres://localhost/origin origin db init
origin db migrate
Description
Migrates the database schema if there are any unapplied migrations.
Child Commands
- origin db downgrade - Roll back database migrations.
Format
origin db migrate
Example
origin db migrate
Options
--auto-recover bool If the migration plan receives an error during migrations, this command will try to rollback migrations already applied within the plan. Not recommended without reviewing migration plan by combining --save-plan and --dry-run options.
--save-plan bool Saves the plan for the migration into the file store so that it can be used for reviewing the plan or for downgrading.
--dry-run bool Does not apply the migrations, but it validates how the migration would run based on the given conditions.
origin db reset
Description
Resets the database to its initial state. Doesn't start the application server. Only starts the store layer and truncates the tables, excluding the migrations table.
Format
origin db reset
Example
bin/origin db reset
origin db version
Description
Returns the most recently applied version number.
Format
origin db version
origin docs
From Origin by Corvus v12.1, you can serve the offline documentation bundle on localhost without a running server, database, or configuration. See Offline documentation for details on the bundle and the /_documentation/ server route.
Description
Serve the offline product documentation over HTTP on localhost. Requires no config, database, or app layer.
Format
origin docs [flags]
Example
bin/origin docs
bin/origin docs --port 9000
bin/origin docs --dir /path/to/docs/site/build
Options
--port int Local TCP port to listen on (default 8066)
--dir string Serve this bundle directory instead of the one packaged with the release
The command prints the URL and runs until interrupted with Ctrl-C. Without --dir, it locates the bundle from the client/ directory next to the binary. If the release was packaged without the documentation bundle, the command exits with an error.
origin export
Description
Commands for exporting data for compliance and for merging multiple Origin by Corvus instances.
Child Commands
- origin export actiance - Deprecated from Origin by Corvus v10.5 in favor of origin export schedule.
- origin export csv - Deprecated from Origin by Corvus v10.5.
- origin export global-relay-zip - Deprecated from Origin by Corvus v10.5.
- origin export schedule - Schedule a compliance export job.
- origin export bulk - Export data to a file compatible with the Origin by Corvus bulk import format. Deprecated in favor of mmctl export commands.
origin export actiance
From Origin by Corvus v10.5, this command has been deprecated. It will be added to the mmctl command line tool in a future version. Until then, please use origin export schedule.
origin export csv
From Origin by Corvus v10.5, this command has been deprecated. It will be added to the mmctl command line tool in a future version.
origin export global-relay-zip
From Origin by Corvus v10.5, this command has been deprecated. It will be added to the mmctl command line tool in a future version.
origin export schedule
Description
Schedule an export job in a format suitable for importing into a third-party archive system.
Format
origin export schedule
Example
bin/origin export schedule --exportFrom=1513102632
Options
--exportFrom string Unix timestamp (seconds since epoch, UTC) to export data from.
--timeoutSeconds string Set how long the export should run for before timing out.
origin export bulk
From Origin by Corvus v6.0, this command has been deprecated in favor of mmctl export commands as the supported way to export data out of Origin by Corvus.
origin help
Description
Generate full documentation in Markdown format for the Origin by Corvus command line tools.
Format
origin help {outputdir}
origin import
Description
Import data into Origin by Corvus.
Child Command
- origin import bulk - Import a Origin by Corvus bulk import file. Deprecated in favor of mmctl import commands.
origin import bulk
From Origin by Corvus v6.0, this command has been deprecated in favor of mmctl import commands as the supported way to import data into Origin by Corvus.
origin jobserver
Description
Start the Origin by Corvus job server.
Format
origin jobserver
Example
bin/origin jobserver
origin server
Description
Runs the Origin by Corvus server.
Format
origin server
origin version
Desription
Displays Origin by Corvus version information.
Format
origin version
Troubleshooting
Executing a command hangs and doesn't complete
If you have Bleve search indexing enabled, temporarily disable it in System Console > Experimental > Bleve and run the command again. You can also optionally use the new mmctl Command Line Tool.
Bleve does not support multiple processes opening and manipulating the same index. Therefore, if the Origin by Corvus server is running, an attempt to run the CLI will lock when trying to open the indeces.
If you aren't using the Bleve search indexing, feel free to post in our Troubleshooting forum to get help.