0

Is it possible to get data from a Filemaker Pro database and insert it into the database for a Drupal site?

Ideally, I'd like to set this up so that Drupal would periodically check the Filemaker database and import any new (or updated) data into its database.

0

Yes, it's possible.

You can use the Migrate module from Drupal 8. This module allows you to import data from an SQL source. You have to create a custom module to configure the migration. In that module, you should create a migrate source plugin class extending the abstract SqlBase class provided by the core Migrate module.

The SQL source plugin must implement three methods:

  • query(): Returns the query that selects the data from the source database.
  • fields(): Returns available fields on the source.
  • getIds(): Defines the source fields uniquely identifying a source row.

Plus, you'll have to declare the connection to the source database in the settings.php or settings.local.php file. So, you'll have the Drupal 8 connection configuration and your migrate source database:

$databases['migrate']['default'] = array (
  'database'  => 'source-database-name',
  'username'  => 'source-database-username',
  'password'  => 'source-database-password',
  'host'      => 'source-database-server',
  'port'      => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver'    => 'mysql',
);

Finally, you need you define the migration that uses your created plugin and the database:

id: filemakerpro
label: 'Filemaker Pro'
source:
  plugin: filemakerpro
  key: migrate
process:
  title: title
  field_datetime: datetime
  field_place: place
destination:
  plugin: 'entity:node'
  default_bundle: yourbundle

Once you have done this, you need to execute the migration. You can execute it periodically and migrate will add the content.

You can have more information in the Migrating data from a SQL source (the info I posted here is a briefing from that link).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.