{"id":15726703,"url":"https://github.com/grasmash/migrate_html","last_synced_at":"2025-07-21T21:32:09.694Z","repository":{"id":25444552,"uuid":"28874483","full_name":"grasmash/migrate_html","owner":"grasmash","description":"Example module for migrating static HTML to Drupal","archived":false,"fork":false,"pushed_at":"2015-01-16T01:49:45.000Z","size":176,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"7.x-1.x","last_synced_at":"2025-03-31T01:41:19.146Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grasmash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-06T17:26:44.000Z","updated_at":"2023-09-25T08:31:02.000Z","dependencies_parsed_at":"2022-08-03T15:11:09.757Z","dependency_job_id":null,"html_url":"https://github.com/grasmash/migrate_html","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/grasmash/migrate_html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grasmash%2Fmigrate_html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grasmash%2Fmigrate_html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grasmash%2Fmigrate_html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grasmash%2Fmigrate_html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grasmash","download_url":"https://codeload.github.com/grasmash/migrate_html/tar.gz/refs/heads/7.x-1.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grasmash%2Fmigrate_html/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266382406,"owners_count":23920703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T22:40:23.693Z","updated_at":"2025-07-21T21:32:09.662Z","avatar_url":"https://github.com/grasmash.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Overview\n\nThis module provides a robust library of migration classes that support the\nmigration of static HTML files into Drupal nodes.\n\nThe base classes included in this module allow for two types of custom \nmigrations to be created:\n* Static HTML to node\n* Binary file to file entity\n\nThese base classes will do the following\n* Scan the defined source directories for matching HTML files\n* Instantiate QueryPath object for you source HTML, allowing you to manipulate\n  DOM elements and set field values in migrate's prepareRow() method.\n* Create a redirect from the legacy HTML path to the new Drupal node.\n\nTo implement these classes for your own migration, do the following:\n* Enable the migrate_html module. `drush en migrate_html -y`\n* Copy the source files (from your legacy, static HTML site) to your local\n  machine\n* Set the migrate_html_base_dir variable so that it points to the directory\n  only your local machine containing the source files:\n  `drush vset migrate_html_base_dir \"/path/to/legacy/files\"`\n* To create a node migration class:\n  * Create a new include file for your new class. E.g., \n    MyCustomNodeMigration.inc \n  * Add the new include file to the files[] array in your module's .info file\n  * Create a new class in your include file by extending \n    StaticHtmlToPageMigration. See ExamplePageMigration in \n    ExamplePageMigration.inc for example implementation.\n  * As per the instructions provided by the migrate module, implement \n    hook_migrate_api() in a *.migrate.inc file for your module to register \n    your migration class.\n* To create a binary file migration class:\n  * Create a new include file for your new class. E.g., \n    MyCustomFileMigration.inc \n  * Add the new include file to the files[] array in your module's .info file\n  * Create a new class in your include file by extending \n    BinaryFileMigration. See ExampleBinaryFileMigration in \n    ExampleBinaryFileMigration.inc for example implementation.\n  * As per the instructions provided by the migrate module, implement \n    hook_migrate_api() in a *.migrate.inc file for your module to register \n    your migration class.\n\nAdditionally, this module provides a strategy for handling \n\n## OOP Architecture\n\nThere are three types of classes that you may need to extend in order to\nwrite a custom migration:\n* Migration class. This class is primarily responsible for mapping data from\n  source to destination, and for executing the migration. It also deals with all\n  processing of Drupal entities.\n* SourceParser class. The responsibility of this class is to accept an HTML \n  source file and to create a clean QueryPath object available for DOM \n  manipulation.\n* Cleaner classes. These static classes contain functions that the SourceParser\n  may use to clean strings or QueryPath object markup.\n* Obtainer class. An obtainer class attempts to extract a specific snippet of \n  HTML from a QueryPath object using a stack of finder methods and return it\n  to the SourceParser.\n\n\n## Requirements\n* Composer\n* migrate module\n* redirect module\n\n## Installation\n\ndrush en migrate_html\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrasmash%2Fmigrate_html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrasmash%2Fmigrate_html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrasmash%2Fmigrate_html/lists"}