Skip to main content

Blog

Sign up to be notified when Agaric gives a migration training:

You – our clients, colleagues, and crazed adoring fans – are the reason we do what we do. We would love to hear from you.

Websites powered by Find It connect people to all that their communities have to offer.  Developed under the guidance of the Cambridge Kids' Council, Find It ensures that people from all backgrounds can easily find activities, services, and resources.

Find It's design was informed by hundreds of hours of research, including over 1,250 resident surveys and over 120 interviews with service providers. Six years of research and development and continuous improvements has resulted in the Find It approach and platform, ready to be implemented in cities and communities around the world.

The platform is Free and Open-source and flexible so that communities can customize it to their own needs. Whether you are city IT staff, a developer that works with cities, or are anyone that could use a Find It in your community, we would love to talk. 

 

We value learning new things and helping one another, so every Thursday at 3pm Eastern Time we take an hour to share things we are working on. We have deep conversations on the ways we can work together We use screen-sharing to show projects we are involved in and sometimes we doodle on the white board as we talk. 

Show and Tell Collaborative Doodle

Everyone is welcome to join the chat or just listen. The informal atmosphere supports us getting to know each other better and form stronger relationships. Anyone can suggest a topic for discussion or give a presentation or ask for input and help on a project. We use a poll to determine if we want to record the session.   Agaric hosts these show and tells publicly because we realize some of us work alone or in organizations that do not encourage skill-sharing, or may just be interested in broadening their knowledge or sharing some code.  So we invite you—our partners, students, colleagues, friends—to take part in watching or giving short presentations.

Direct link to the Show and Tell chatroom

Get on the Show and Tell Mailing List   to receive invitations each week with the upcoming topics. 

Do you want to host a Show and Tell discussion or presentation? Here is the email template to send  a notice to the list at: showandtell@lists.mayfirst.org  If you are already signed up on the email list, you should be able to send a notice to the group! Feel free to choose an alternative time if Thursdays at 3PM ET does not work well for you - experiment!

We shall see you soon!

 

Just got back to Boston from GLADCamp, the Greater Los Angeles Drupal Camp, a free community three-day event and one of the best camps I have attended. The theme was "Drupal for Good" and it delivered from the opening keynote to the closing barn raising.

I was glad to present two sessions at this camp, which was organized by volunteers from the Greater Los Angeles Drupal community—whose user group boasts 5 to 10 events a month—such as Christefano Reyes and Lee Vodra of Exaltation of Larks and an extensive list of Drupal community members and participating sponsors.  The free conference took place on March 7th, 8th & 9th, 2014, at the Hilton Pasadena & Convention Center in Pasadena, California. This camp had a lot to offer in the way of sessions and was one of the best camps I have attended due to...

  • Sessions organized into logical tracks.
  • Transparency of finances and process.
  • High level of interaction between attendees and presenters.
  • Top-notch keynote speakers and topics.

Intro to Drupal 1,2,3 - with Lee Vodra - Exhaltaion of LarksThe sessions were set up specifically so that attendees would not have to change conference rooms as often - and it worked, as I heard several people make positive remarks about the schedule. GLADCamp session tracking was chosen very wisely, and lots of them contained valuable information for start-ups, non-profits and people just starting to learn Drupal. The track for advanced developers was also very rich, and well planned. Most of the sessions offered Q+A time and/or hands on learning.

See a list of all the GLADCamp sessions here: https://gladcamp.org/2014/program/sessions

To the right is a pic from the Intro to Drupal 1, 2, 3 session led by Lee Vodra a co-founder of Exaltation of Larks.  

Advanced coders had excellent choices such as:

  • Search API Solr Setup
  • AJAX and jQuery with Drupal: Loading Nodes into the DOM without Reloading the Page
  • Advanced Views
  • Responsive Layouts with Omega4, SingularityGS and Breakpoint
  • The Symfony Way

Beginners and non-coders had choices such as:

  • Drupal Install Fest
  • Intro to Drupal 1, 2, 3 - Two Hour Session
  • Introduction to Views in Drupal 8
  • VoipDrupal - Your Site and a Regular Phone
  • Estimation for Drupal Projects: Reducing Uncertainty & Defining the Client Relationship

As FreeScholar, I presented two sessions - my first was tracked in "Business, Strategy & Case Studies" and was titled: "Drupal Community - The big picture - How do I earn $". This session was mostly a discussion around ways of forming a collective of Drupalists that take on projects that suit their goals and ideas. As a collective people can determine the best way to divide and use their 'collective' profits to fund causes that are near and dear to their hearts - such as FSF.org and EFF.org.  My second session was on VoipDrupal, a suite of modules developed at the MIT Media Lab by Dr. Leo Burd and a team of developers. The session was titled "VoipDrupal - Your Site and a Regular Phone", and it was tracked in "Site Building & Using Drupal".  VoipDrupal allows your website to interact with a regular telephone using a VOIP telephony service. This session was an overview of the core VoipDrupal modules and a live demonstration of the conference calling on the fly feature, some people caught up with me between the next sessions and were actively interested in using VoipDrupal on their current Drupal projects.

A fantastic time was had by all! Pasadena Media captured the whole GLADCamp event and will be incorporating the slides into the footage of the sessions. Of all the sessions, the Barn Raising was one of the MOST impressive. Pasadena Media was the recipient of the effort and they were gifted with about 15-20 developers/designers collaborating on the start of a Drupal 7 site that now has content types and some roles defined along with some custom menus - all created using Drupal's Best Practices!.

Since 1997 MIT's Cultura has brought students from two different parts of the world together in a series of online exchanges which help each group understand the other's culture. Students respond anonymously to thought-provoking prompts in their own languages and then discuss their classes' pair of responses bilingually.

Created by a French language class at MIT as an exchange between American students and French students, the project grew to include more than 30 schools and eight languages. A pioneer in international collaborative learning, Cultura also pioneered sharing the learning online.

Unfortunately, by 2014, most of Cultura's 18 years worth of archives were no longer online. To get them back on the web, Agaric used the Migrate module to bring their collection of HTML files into Drupal. A common approach for migrating from a list of files, each file representing what will become a node in Drupal, is to use MigrateSourceList as a source. It needs an instance of MigrateList and an instance of MigrateItem representing the collection and the individual entity.

The Migrate module provides the class MigrateItemXml for importing content from XML files, but our input happens to be HTML from the late 1990s and early 2000s. Luckily libxml which powers PHP XML support can also deal with HTML. Hence it does not require a lot of work to create a subclass of MigrateItemXml that can work with HTML files. The only method we needed to override is MigrateItemXml::loadXmlUrl which is expected to return an instance of SimpleXMLElement.

class MigrateItemHTML extends MigrateItemXML {
  protected function loadXmlUrl($item_url) {
    $dom = new DOMDocument();
    $dom->loadHTMLFile($item_url);
    return simplexml_import_dom($dom);
  }
}

This class can now be used to set up the source of a migration:

abstract class CulturaMigration extends XMLMigration {
  public function __construct($arguments) {
    // ...
    $base_dir = DRUPAL_ROOT . '/../archives';
    $directories = array(
      "$base_dir/{$arguments['directory']}",
    );
    $file_mask = '/(.*\.htm$|.*\.html$)/i';
    $list = new MigrateListFiles($directories, $base_dir, $file_mask);
    $item = new MigrateItemHtml($base_dir . ':id');
    $this->source = new MigrateSourceList($list, $item);
    // ...
  }
  // ...
}

Through the archives we can learn many interesting things, such as that some students at MIT literally don't know the meaning of solidarity.

"Wirth Co-op won't reopen", a tiny heading on the front page of North News announced. The story ran inside on page four.

The grocery store, right in my neighborhood, set out to build community wealth and provide healthy food in north Minneapolis. The loss of its promise is crushing.

Wirth Grocery's failure to act as a cooperative—with its own existence at stake—is even more upsetting. Cooperatives are one of the few spaces where people have a chance to take collective control of something that matters to them.

One epic month of blog post tutorials about migrating into Drupal 8 and 9 by Mauricio who also is the driving force behind Agaric's migration trainings and Agaric's upgrade services.

One man.  One month.  Many migrations.

Hear from us

Keegan is a Web Developer, focused mostly on building sites using Drupal and/or front-end JavaScript frameworks (like React.js), and is also a Drupal core contributor.

Keegan's longest-lived hobbies are being in nature, sonic-doodling, and studying the history and philosophy of science and technology. Having a degree in Environmental Science and Technology, Keegan learned early that there is no deficiency in the capabilities of modern technology to create a more equitable and sustainable global infrastructure, but a lack of funding. Hence, Keegan believes that the future of societal health depends on collective efforts to provision and employ information and communications infrastructure that is owned and controlled by the people who use it—not by the full-fledged military contractors that big tech comprises—so that love, democracy, community, and eco-friendly infrastructure can thrive.

Keegan is inspired, as a worker-owner of a tech coop, to have recognized the practical benefits of Libre software and of the cooperative model toward the respective protection and cultivation of attentional liberation, and is always beyond delighted to hear whenever someone else has made the same or similar discoveries. Most of all, Keegan is humbled to be immersed in a positive work-culture that emphasizes action-oriented ethical practices, and to be surrounded day-to-day by brilliant friends and mentors.

Agaric, as a worker collective, does not have bosses and employees. We have skilled, hard-working teammates coming together to figure out and do ... everything.

We will make an exception to hire an excellent business director, project leader, attention-to-detail-and-the-big-picture person. If you happen to be a front end dev too, then great! If not, well, part of your role will be helping bring on more talent.

In addition to forging grand coalitions and leading amazing projects, we need help keeping track of invoices and payments and doing financial planning, managing people's skills and availability, and writing role descriptions way better than this one.

We want someone who expects within six months of joining us to have helped make things 300% more awesome. As a principal or a hired boss, part of this role will be making the decisions of what to prioritize, and saying no to potential projects that don't fit.

OK we'll just say it: We want someone to be Agaric's Liza Kindred.

Want to be part of something that's bigger than yourself, that works on projects and ideas bigger still?

Agaric's model is Free and Open: free and open standards, free and open work and management, free and open source code, free and open documentation. So be prepared to help us share everything we build, as a collective company and with code, to the Drupal community and beyond.

Agaric is not just about doing web work as a collective. We work on interesting, exciting projects (both client work for solid financial compensation and our own platform-building initiatives for dreams of riches). We then, also collectively, take some of the resources, skills, and connections we gain in this work to help build tools, networks, and open learning projects that change the world for the better. We see tremendous potential for a better world by helping people gain more control over their own lives, and open source free software is both a metaphor and a tool for how we can better lives.

We welcome serious and/or comical inquiries.

Transformation Inside and Out: North American Social Solidarity Economy Forum Participants Gather in Detroit for Reflection and Revitalization

In Detroit, many once thriving neighborhoods lay in ruins. Most of the houses in many city blocks can be in a state of severe disrepair, including some that have been completely gutted or burned, with perhaps one or two inhabitable homes that appear to still have people living in them. It should also be noted that 62,000 homes in Detroit last year were foreclosed. It looked like a city after a war.

Where do you think the children play?

I went to Detroit to attend the Social Solidarity Economy Network Forum. Organized by the Intercontinental Network for the Promotion of Social Solidarity Economy, or RIPESS, the forum addressed several problems by raising awareness that this type of economic debauchery is contagious unless we as citizens deal with it where it lives and rout it out from the roots - which inevitably lie in system-wide corruption. The Social Solidarity Economy Network Forum took place in April, and it was the first project of this North American coalition.

RIPESS is based on human values, diversity, inclusiveness, creativity and justice, and works to connect democratic workplaces, cooperative and individuals with the same values in local, national, regional and global frameworks. This is a huge effort and will take time, but this year, RIPESS and other sponsors made the NASSE Forum possible. The overall unifying message and focus of the North American Solidarity Economy Network Forum was three-fold:

  1. self-care is a topic I heard a lot of people repeating as a number one issue to consider - no one can help a movement without taking care of themselves first - period.
  2. “De-Colonization” of the movement
  3. Strengthening our connections to each other and to our communities were the topics that most workshops took time to discuss, even if not on their agenda. Cooperative people came from around the globe to share experiences and lessons learned on our journey towards building a solidarity economy network.

Laura Flanders was host to the opening of the conference and William Copeland (East Michigan Environmental Action Council) welcomed everyone to the event. Emily Kawano (RIPESS and US Solidarity Economy Network) gave the opening plenary as an overview of the International Social Solidarity Economy movement and defined the role of NASSE.

The crowd of 400+ citizens of the planet convened in solidarity at The Samaritan Behavioral Center where people could gather in small workshops to discuss and find paths to eradicate racism, sexism, cultural blockades and to unite on some single purpose methods to change the world we live in. The conference was a success in that it brought a diverse group of people together to transform the Solidarity Economy movement together and move forward on the road to "ownership" of the tools and the means of production! Many people at the forum represented a worker-owned cooperative, and are members of the United States Federation of Worker Cooperatives (USFWC). This organization does a tremendous job of gathering resources and sponsoring events that raise awareness and bring worker solidarity to the forefront of the Solidarity Economy Movement.

The Samaritan Behavioral Center had a large auditorium for the plenaries, group activities and panels which spoke to the group as a whole. The workshops were held in smaller conference rooms where people could easily participate in the conversations and connect with people to exchange contact information. In the large gathering hall panels with guests from Mexico, Canada, Greece and other parts of the world discussed how solidarity has affected their communities and what measures are needed to be put in place for the future generations to maintain solidarity. A generous time was allotted for questions and answers, of which there were plenty. Two Questions that come to mind addressed human rights and acknowledging that access to the Internet is a human right, which I will detail later in this article.

Free software for the revolution! Yes, we all agreed that the foundation of any people's movement for freedom must be built on a solid platform of freedom, not the privately owned platform. This means that we must build the future using free software, and free hardware must be a component also. How will we do this on the ground?

There must be free workshops for people in their own towns to learn about the options for privacy and security along with protecting their liberty. This brings to the forefront the Free Software Foundation in Boston, MA. The foundation is at the epicenter of our future freedoms and has many volunteers that help to raise awareness and introduce free software to the world through the GNU project.

The GNU project is a collection of free software available for downloading. Their tireless efforts working with other organizations that protect our freedom, like the Electronic Frontier Foundation will make the world a better place for each individual citizen, and the collective population also.

What are the highlights from the North American Solidarity Economy Forum (NASSE) in Detroit on April 8th through the 10th? The conference was well organized with plenaries, panels and enough smaller break-out workshops that allowed maximum interaction between participants. Diversity was present in all ways imaginable with people from around the globe in attendance. I met people from Greece, Canada and Mexico that are all involved in similar efforts to raise the cooperative levels in their community.

People listening to a presenter at the North American Solidarity Economy Forum.
People from Detroit to Athens and all across the world came to discuss solidarity economics.

The program of inter-related workshop and panel topics addressed by this event showed that a great amount of thinking went into the details and to covering the most vital issues that can propel a movement forward. Three topics emerged as the focal points of NASSE, and they are conversations and actions based on de-colonization of the Solidarity Economy, inclusion and getting to know each other better and the use of free software for the platforms we build and share.

The workshops consisted of many different tracks such as “Intro to the Solidarity Economy”, facilitated by Julie Matthaei and Jessica Gordon Nembhard of SEN. This open discussion covered the definition of the movement. It is really important to have an introduction to the framework of the Solidarity Economy at all events, for people new to the movement. There was one titled “Occupy, Resist, Produce. A talk with workers of the occupied Vio.Me factory in Greece”. Workers from Vio.Me Factory in Salonica, Greece detailed how they occupied their workplace and resumed production, while waging a legal battle to stop the corporation from selling the land. An amazing group discussion ensued.

All of the workshops were inter-connected in general theme as they relate to a community. What is good for the community in the way of connecting people to support creativity, privacy, autonomy and wealth - specifically communal wealth, without which a community does not truly exist. Wealth has been defined by a financial measure and the worth of a person is measured according to their assets. The Solidarity Economy Movement shows us that belonging to a community that treats members well and operates on the 7 Cooperative Principles can be the future.

At the conference, I facilitated a workshop titled: "Internet as a Human Right: the Role of Cooperatives and the Solidarity Economy" hosted by Juan Gerardo Dominguez Carrasco, MayFirst People Link. We talked about the Internet as an educational tool and foundation of our emerging new connected society. The need for rapid communication of information is not just a desired element, it is a necessity for being a relevant contributing member of a community and a citizen of the world. Without the Internet a person is relegated to a level of ignorance that will limit them to being low wage earners and unskilled workers.

Old, abandoned building in Detroit

There were workshops on a financial track that presented strategies for communities to practice alternative banking methods such as time banking and group loans for local initiatives. Ed Whitfield and Marnie Thompson both of the Fund for Democratic Communities in Greensboro, N.C., led a powerful workshop and discussion based on a cooperative they are helping to develop The Renaissance Community Co-op (RCC) in Greensboro, North Carolina. Their efforts will provide healthy food and a positive workplace for locals. They shared the methods they have been using to build a business that sustains the community. Local to Detroit, the West Grand Boulevard Collaborative, started in October, 2004, by Mildred Hunt Robbins and Tommie E. Robbins, Jr. is currently making good progress in revitalizing the community they live in. Plans have been made to renovate a gutted high rise building. They formed a group to have an alliance with neighbors and to have a bigger voice when raising concerns with the city.

De-colonization of the Solidarity Economy Movement was front and center in almost every aspect of the event. We are defining what it means to grow up colonized into an Extractive Economy (one that does not re-invest in the communities where the workers live) and the pathways to exit that state of mind, old traditions and ideologies. Some workshops that included a discussion on de-colonization found that listening to people add their voice to the solutions was inspiring. Inspiration alone does not a movement make. More is needed to give people the strength and fortitude to carry the movement forward. Workshops on healing and healthful living are a large part of the solidarity economy as we begin to treat the sources of trauma instead of just the symptoms. Creative problem solving along with collaborative games and exercises promotes good relationships. Action is another part of the solution and together, in solidarity, we can define powerful ways to act. One of many great examples of 'action', is Cooperation Jackson in Mississippi. They are taking some positive direct actions to change laws and city ordinance by working with the mayor and town officials to make changes on specific issues that affect their community. By having open and inclusive discussions and presenting solutions to problems, cooperators have found that some of their local representatives have ears.

A great way to get involved is to ask questions of your local activists and see what initiatives are already in progress. Detroit is not unique and this type of devastation can happen anywhere if we are not vigilant and constantly remaining alert to changes in laws and ordinances where we live. When Government services are removed from a city, neglect and decay prevail. The civil servants of Detroit have been remiss in their duties by implementing pernicious policies that have destroyed the city and led to bankruptcy, as this case study shows. I would love to hear about the efforts in your area to prevent Detroit policies that led to this destruction of lives and homes from landing on your doorstep.

Originally published by Grassroots Economic Organizing.

a crowd of people.

Today we will learn how to migrate content from Microsoft Excel and LibreOffice Calc files into Drupal using the Migrate Spreadsheet module. We will give instructions on getting the module and its dependencies. Then, we will present how to configure the module for spreadsheets with or without a header row. There are two example migrations: images and paragraphs. Let’s get started.

Example configuration for Microsoft Excel and LibreOffice Calc migration.

Getting the code

You can get the full code example at https://github.com/dinarcon/ud_migrations.

The module to enable, as in yesterday's post in which we imported Google Sheets, is UD Google Sheets, Microsoft Excel, and LibreOffice Calc source migration whose machine name is ud_migrations_sheets_sources. It comes with four migrations: udm_google_sheets_source_node.yml, udm_libreoffice_calc_source_paragraph.yml, udm_microsoft_excel_source_image.yml, and udm_backup_csv_source_node.yml. The image migration uses a Microsoft Excel file as source. The paragraph migration uses a LibreOffice Calc file as source. The CSV migration is a backup in case the Google Sheet is not available. To execute the last one you would need the Migrate Source CSV module.

You can get the Migrate Spreadsheets module using composer: composer require drupal/migrate_spreadsheet:^1.0. This module depends on the PHPOffice/PhpSpreadsheet library and many PHP extensions including ext-zip. Check this page for a full list of dependencies. If any required extension is missing the installation will fail. If your Drupal site is not composer-based, you will not be able to use Migrate Spreadsheet, unless you jump through a lot of hoops.

Understanding the example set up

This migration will reuse the same configuration from the introduction to paragraph migrations example. Refer to that article for details on the configuration. The destinations will be the same content type, paragraph type, and fields. The source will be changed in today's example, as we use it to explain Microsoft Excel and LibreOffice Calc migrations. The end result will again be nodes containing an image and a paragraph with information about someone’s favorite book. The major difference is that we are going to read from different sources.

Note: You can literally swap migration sources without changing any other part of the migration.  This is a powerful feature of ETL frameworks like Drupal’s Migrate API. Although possible, the example includes slight changes to demonstrate various plugin configuration options. Also, some machine names had to be changed to avoid conflicts with other examples in the demo repository.

Understanding the source document and plugin configuration

In any migration project, understanding the source is very important. For Microsoft Excel and LibreOffice Calc migrations, the primary thing to consider is whether or not the file contains a row of headers. Also, a workbook (file) might contain several worksheets (tabs). You can only migrate from one worksheet at a time. The example documents have two worksheets: UD Example Sheet and Do not peek in here. We are going to be working with the first one.

The spreadsheet source plugin exposes seven configuration options. The values to use might change depending on the presence of a header row, but all of them apply for both types of document. Here is a summary of the available configurations:

  • file is required. It stores the path to the document to process. You can use a relative path from the Drupal root, an absolute path, or stream wrappers.
  • worksheet is required. It contains the name of the one worksheet to process.
  • header_row is optional. This number indicates which row containing the headers. Contrary to CSV migrations, the row number is not zero-based. So, set this value to 1 if headers are on the first row, 2 if they are on the second, and so on.
  • origin is optional and defaults to A2. It indicates which non-header cell contains the first value you want to import. It assumes a grid layout and you only need to indicate the position of the top-left cell value.
  • columns is optional. It is the list of columns you want to make available for the migration. In case of files with a header row, use those header values in this list. Otherwise, use the default title for columns: A, B, C, etc. If this setting is missing, the plugin will return all columns. This is not ideal, especially for very large files containing more columns than needed for the migration.
  • row_index_column is optional. This is a special column that contains the row number for each record. This can be used as unique identifier for the records in case your dataset does not provide a suitable value. Exposing this special column in the migration is up to you. If so, you can come up with any name as long as it does not conflict with header row names set in the columns configuration. Important: this is an autogenerated column, not any of the columns that come with your dataset.
  • keys is optional and, if not set, it defaults to the value of row_index_column. It contains an array of column names that uniquely identify each record. For files with a header row, you can use the values set in the columns configuration. Otherwise, use default column titles like A, B, C, etc. In both cases, you can use the row_index_column column if it was set. Each value in the array will contain database storage details for the column.

Note that nowhere in the plugin configuration you specify the file type. The same setup applies for both Microsoft Excel and LibreOffice Calc files. The library will take care of detecting and validating the proper type.

Migrating spreadsheet files with a header row

This example is for the paragraph migration and uses a LibreOffice Calc file. The following snippets shows the UD Example Sheet worksheet and the configuration of the source plugin:

book_id, book_title, Book author
B10, The definitive guide to Drupal 7, Benjamin Melançon et al.
B20, Understanding Drupal Views, Carlos Dinarte
B30, Understanding Drupal Migrations, Mauricio Dinarte
source:
  plugin: spreadsheet
  file: modules/custom/ud_migrations/ud_migrations_sheets_sources/sources/udm_book_paragraph.ods
  worksheet: 'UD Example Sheet'
  header_row: 1
  origin: A2
  columns:
    - book_id
    - book_title
    - 'Book author'
  row_index_column: 'Document Row Index'
  keys:
    book_id:
      type: string

The name of the plugin is spreadsheet. Then you use the file configuration to indicate the path to the file. In this case, it is relative to the Drupal root. The UD Example Sheet is set as the worksheet to process. Because the first row of the file contains the header rows, then header_row is set to 1 and origin to A2.

Then specify which columns to make available to the migration. In this case, we listed all of them so this setting could have been left unassigned. It is better to get into the habit of being explicit about what you import. If the file were to change and more columns were added, you would not have to update the file to prevent unneeded data to be fetched. The row_index_column is not actually used in the migration, but it is set to show all the configuration options in the example. The values will be 1, 2, 3, etc.  Finally, the keys is set the column that serves as unique identifiers for the records.

The rest of the migration is almost identical to the CSV example. Small changes were made to prevent machine name conflicts with other examples in the demo repository. For reference, the following snippet shows the process and destination sections for the LibreOffice Calc paragraph migration.

process:
  field_ud_book_paragraph_title: book_title
  field_ud_book_paragraph_author: 'Book author'
destination:
  plugin: 'entity_reference_revisions:paragraph'
  default_bundle: ud_book_paragraph

Migrating spreadsheet files without a header row

Now let’s consider an example of a spreadsheet file that does not have a header row. This example is for the image migration and uses a Microsoft Excel file. The following snippets shows the UD Example Sheet worksheet and the configuration of the source plugin:

P01, https://agaric.coop/sites/default/files/pictures/picture-15-1421176712.jpg
P02, https://agaric.coop/sites/default/files/pictures/picture-3-1421176784.jpg
P03, https://agaric.coop/sites/default/files/pictures/picture-2-1421176752.jpg
source:
  plugin: spreadsheet
  file: modules/custom/ud_migrations/ud_migrations_sheets_sources/sources/udm_book_paragraph.ods
  worksheet: 'UD Example Sheet'
  header_row: 1
  origin: A2
  columns:
    - book_id
    - book_title
    - 'Book author'
  row_index_column: 'Document Row Index'
  keys:
    book_id:
      type: string

The plugin, file, amd worksheet configurations follow the same pattern as the paragraph migration. The difference for files with no header row is reflected in the other parameters. header_row is set to null to indicate the lack of headers and origin is to A1. Because there are no column names to use, you have to use the ones provided by the spreadsheet. In this case, we want to use the first two columns: A and B. Contrary to CSV migrations, the spreadsheet plugin does not allow you to define aliases for unnamed columns. That means that you would have to use A, B in the process section to refer to these columns.

row_index_column is set to null because it will not be used. And finally, in the keys section, we use the A column as the primary key. This might seem like an odd choice. Why use that value if you could use the row_index_column as the unique identifier for each row? If this were an isolated migration, that would be a valid option. But this migration is referenced from the node migration explained in the previous example. The lookup is made based on the values stored in the A column. If we used the index of the row as the unique identifier, we would have to update the other migration or the lookup would fail. In many cases, that is not feasible nor desirable.

Except for the name of the columns, the rest of the migration is almost identical to the CSV example. Small changes were made to prevent machine name conflicts with other examples in the demo repository. For reference, the following snippet shows part of the process and destination section for the Microsoft Excel image migration.

process:
  psf_destination_filename:
    plugin: callback
    callable: basename
    source: B # This is the photo URL column.
destination:
  plugin: 'entity:file'

Refer to this entry to know how to run migrations that depend on others. In this case, you can execute them all by running: drush migrate:import --tag='UD Sheets Source'. And that is how you can use Microsoft Excel and LibreOffice Calc files as the source of your migrations. This example is very interesting because each of the migration uses a different source type. The node migration explained in the previous post uses a Google Sheet. This is a great example of how powerful and flexible the Migrate API is.

What did you learn in today’s blog post? Have you migrated from Microsoft Excel and LibreOffice Calc files before? If so, what challenges have you found? Did you know the source plugin configuration is not dependent on the file type? Share your answers in the comments. Also, I would be grateful if you shared this blog post with others.

Next: Defining Drupal migrations as configuration entities with the Migrate Plus module

This blog post series, cross-posted at UnderstandDrupal.com as well as here on Agaric.coop, is made possible thanks to these generous sponsors. Contact Understand Drupal if your organization would like to support this documentation project, whether it is the migration series or other topics.

Learning Objectives

  • Understand the different approaches to upgrading your site to Drupal 11 using the Migrate API.
  • Revise site architecture and map configuration from the previous site to the new one
  • Use the Migrate Drupal UI module to understand module requirements for running upgrades.
  • Use the Migrate Upgrade module to generate migration files.
  • Cherry-pick content migrations for getting a content type migrated to Drupal 11.
  • Modify a migration to convert a content type to a user entity.
  • Modify a migration to convert a content type to a paragraph entities.
  • Migrate images to media entities.
  • Learn about writing a custom process plugin for providing a migrate path for modules that do not include one already.
  • Tips and recommendations upgrade projects.

Prerequisites

This is an advanced course that requires familiarity with the Drupal migration concepts. Our Drupal 11 content migrations training will give you all the background knowledge that you need. Alternatively, you can read the 31 days of migrations series in our blog or watch this video for an overview of the Migrate API.

Setup instructions

Having a Drupal 7 and Drupal 11 local installation is required to take this course. We offer this DDEV-based repository configured with the two Drupal installations used in the training. Alternatively, you can use a tool like Lando or Docksal. You will have to be able to restore a MySQL database dump containing the Drupal 7 database. Drupal 11 site needs to be able to connect to the Drupal 7 database. Drush needs to be installed in order to run migrations from the command line.

This training will be provided over Zoom. You can ask questions via text chat or audio. Sharing your screen, but you might want to do it to get assistance on a specific issue. Sharing your camera is optional.

What to expect

Rocket launch

Prior to the training

Attendees will receive detailed instructions on how to setup their development environment. In addition, they will be able to join a support video call days before the training event to make the the local development environment is ready. This prevents losing time fixing problems with environment set up during the training.

On the days of the training

  • The training totals 7 hours of instruction, which we usually split into 2 sessions.
  • A team of developers available to answer questions and help with training-related issues.

After the training

  • Attendees will receive copies of the training recordings.
  • Attendees will receive a free copy of the 31 days of migrations book.
  • Attendees will receive a certificate of completion.

In the next few weeks, Mauricio Dinarte (dinarcon on drupal.org) will be traveling to deliver his expertise to multiple Drupal events in Europe and America. He is on a mission to continue sharing the knowledge gained from many years as an active member of the Drupal community. Over the last few years he has presented numerous sessions and full day trainings at more than 18 Drupal camp— so you may have been at one of his presentations about Drupal basic concepts, twig recipes, or D8 migrations!

In addition to touring, Mauricio is very active in both local and global communities. He serves as a lead organizer of the Nicaraguan Drupal community where he has trained dozens of people, some of whom have made Drupal their career. He is also a member of the Drupal Global Training - Community Working Group and was recently added to Drupal's MAINTENANERS.txt as part of the mentoring team.

Here is where Mauricio will be presenting next:

Driven by passion to teach others what he has learned, Mauricio's skills go way beyond coding and he has been on a mission to take part in as many International Drupal Cons and Camps as humanly possible. If you happen to be in any of the cities on Mauricio's itinerary, please say hello to him and shake his hand for me. He has touched the lives of many developers and would-be developers, and started some on a path to follow in his footsteps.