Data can be imported from a number of sources and exported to several destinations. Before you begin, you will need a configuration file with settings for your source, destination, filters, and transformations.
Note
All commands listed in this document are run from the root directory of this project.
Before you can use the CLI1 you will need to install dependencies. If you're not used to working with Ruby, we recommend installing the Ruby Version Manager (RVM) to manage your rubies.
Make sure you have a supported version of Ruby installed (3.2+) and run the following to install dependencies:
bundle install --binstubs
The --binstubs
flag will create executables that can be used without
bundle exec
.
You can now run the importer and exporter using the CLI. Make sure you pass the
correct path of your configuration file to --config
.
./bin/importer import --config config/config.yml
./bin/exporter export --config config/config.yml
You can avoid installing and managing dependencies by running the importer and
exporter using the included container and compose file for docker. Make sure you
set IMPORTER_CONFIG_FILE
and EXPORTER_CONFIG_FILE
to the location of your
configuration, otherwise it will look for the default of config/config.yml
.
export IMPORTER_CONFIG_FILE="$(pwd)/config/config.yml"
docker compose up importer
export EXPORTER_CONFIG_FILE="$(pwd)/config/config.yml"
docker compose up exporter
While the importer and exporter tools are great for large operations, you may want to add and update records on an ongoing basis. The API provides an endpoint to import individual records.
Footnotes
-
Command Line Interface ↩