Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

Libcal Training Events Import

Kevin Reiss edited this page Feb 14, 2023 · 1 revision

We are using the built in Drupal Migration API to import data about training that will occur in the future and training that has previously occurred.

We have two migrations CSV and RSS. Past events are retrieved from libcal in CSV format. Future events are retrieved from libcal in RSS format.

Past Events

We will run a one time import of past events when we set the system up using the CSV migration. Upload the csv to the server you are running this on. It will likely be staging and the database will be copied to prod.

cd /var/www/researchdata/current
drush config:status # make sure the status is in sync
sudo -u nginx vi sites/default/config/migrate_plus.migration.event_csv_importer.yml # change line 13 to the file location
drush config:import
drush migrate:import -y event_csv_importer

This should run a migration and import data from a CSV file that has been uploaded to the server.

Future Events

We will run a migration hourly via cron to pick up the latest rss events with the following command. Note:

The locations fields in libcal is required for this data to display properly.

10 * * * * sudo -u nginx /var/www/researchdata/current/vendor/bin/drush migrate:import -y event_rss_importer
Clone this wiki locally