Skip to content

Latest commit

 

History

History
75 lines (54 loc) · 1.99 KB

importing-exporting.md

File metadata and controls

75 lines (54 loc) · 1.99 KB

Importing & Exporting

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.

Using the CLI

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.

Importer

./bin/importer import --config config/config.yml

Exporter

./bin/exporter export --config config/config.yml

Using docker

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.

Importer

export IMPORTER_CONFIG_FILE="$(pwd)/config/config.yml"
docker compose up importer

Exporter

export EXPORTER_CONFIG_FILE="$(pwd)/config/config.yml"
docker compose up exporter

Using the API

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

  1. Command Line Interface