![]() In the case of NEON’s content the volume and uniqueness of data fields, their relational aspects (think tags or entity references), and their inherent complexity (like multiple values for the same field) made it a good candidate on the first account. Migrating CSV data into a Drupal website is perhaps the most cost effective when A) The source data is inherently complex, and B) It can be easily manipulated, reformatted and re-exported to facilitate an easier migration. A deeper dive: Getting spreadsheet or CSV data in Drupal Here’s where manipulating the format of the data in the CSV file becomes particularly handy. Now that we’ve got the basics down, we can move on to exploring some real-world complexities. Note that the ID column is simply a unique identifier, and is not imported into a node attribute. Our title, description, color, and weight columns have imported. Modules/custom/aten_csv_migrate/aten_csv_ ![]() Create a new custom module (or just download my working example) which will include an info file, a migrate file, a source file, and an install file following the outline below.Install and enable Migrate Source CSV, Migrate Tools, and Migrate Plus.Ensure that the core Migrate module is enabled. ![]() Note that this first example doesn’t discuss the more complex sample below, which is also included in the download. The following steps culminate in a working example CSV data migration module you can download and tinker with. For more complex content you’ll define these attributes in the source portion of your migration yaml file. The example below assumes a comma delimiter, no encapsulation characters, and no escape characters. If your data is in spreadsheet format, you’ll want to export it to CSV. Once the basics are clear, a more complex import won’t be so overwhelming. ![]() The basics: Getting spreadsheet or CSV data in DrupalĪ quick introduction to configuring a CSV import using the Migrate Source CSV module for Drupal 8 is warranted. With just a little back and forth, we were well on our way to a successful, complex data migration with minimal custom code. Then their spreadsheets were exported to CSV, a format simple to consume into a Drupal website with the right modules and configurations. Their expertise and flexibility were applied to formatting a spreadsheet export of their data specifically configured for an import into Drupal. Luckily for me, the NEON team are old hands when it comes to spreadsheet manipulation. The bulk of the data was destined for a content type with more than 75 unique fields, and the sheer volume and complexity of the data was steering me away from point-and-click interfaces. When GUIs overwhelm: CSV or Spreadsheet content migrationsĮarlier this year I began working with the National Science Foundation’s National Ecological Observatory Network (NEON) to migrate robust ecological data collected from more than eighty terrestrial and aquatic field sites across the United States into a Drupal 8 website. GUI powered migrations are perfect for minimally to moderately complex content, but can have a hard time crossing the finish line alone for complicated datasets. These modules lay the foundation for a wide variety of migration methods including several flavors of CSV importers like the point-and-click Entity Importer module for Drupal 8 developed by my colleague Travis Tomka. You can download the accompanying Aten CSV Migrate example module here, and skip straight to the instructions if you'd like.ĭrupal 8 offers a handful of powerful and extensible migration modules in core. In this post we’ll get you from zero (fresh Drupal 8 install) to a basic CSV data migration - including entity references and multiple field values - in about 15 or 20 minutes. I’ve written about data migration in Drupal 8 a couple of times, but new projects keep highlighting the diversity of data sources and content configurations, reminding me over and over again that data migration doesn’t really have a one-size-fits-all solution. Content migration into a Drupal website using spreadsheet or CSV data can be surprisingly effective - especially (counterintuitively?) with large and complex datasets.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |