{"id":18262813,"url":"https://github.com/roblib/migrate_book_structure","last_synced_at":"2025-07-30T11:38:15.828Z","repository":{"id":139065803,"uuid":"288225410","full_name":"roblib/migrate_book_structure","owner":"roblib","description":"Drupal 6 to 7 migration for Island Narratives","archived":false,"fork":false,"pushed_at":"2020-10-27T18:58:55.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"7.x-1.x","last_synced_at":"2025-04-09T00:57:37.528Z","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":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roblib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-17T16:05:14.000Z","updated_at":"2020-10-27T18:58:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"05dc5ddc-198e-4144-9330-01943c2c6f34","html_url":"https://github.com/roblib/migrate_book_structure","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/roblib/migrate_book_structure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblib%2Fmigrate_book_structure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblib%2Fmigrate_book_structure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblib%2Fmigrate_book_structure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblib%2Fmigrate_book_structure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roblib","download_url":"https://codeload.github.com/roblib/migrate_book_structure/tar.gz/refs/heads/7.x-1.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblib%2Fmigrate_book_structure/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267858796,"owners_count":24155963,"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-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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-11-05T11:08:52.330Z","updated_at":"2025-07-30T11:38:15.806Z","avatar_url":"https://github.com/roblib.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Migrate Book Structure\n\nThere have been several requests on Drupal.org about\nhow migrating books does not preserve the structure\nhierarchy of a book.\n\nThis module contains a Drupal 7 Drush task to examine a\npreviously-run migration's source and target databases and\nwill re-construct the source book structure in the target Drupal's\nbook and menu tables.\n\n## Fixing Links in Body Text\n\nThis module also provides a Drush command to search through \nall imported pages' body text and update internal links to point\nto the migrated node. The command will also look for external-style\nlinks that should be internal node links. This will allow administrators\nto change the URL paths of migrated content without breaking\nthese previously-hardcoded links.\n\n# Requirements\n\nThis module works after a migration has been run. \n\nIt was not made into a migrate plugin due partly to the \ndifficulty of Drupal 7's migrate API, but also because migrate\nplugins act on each node as it is imported, but to re-create \na book's structure, one must traverse the book's structure\nfrom top-to-bottom, and there is no guarantee that a node's\nparents will all have been previously imported when a given\nnode is being processed. It is also possible to run after a\nDrupal-to-Drupal migration is performed.\n\n# Usage\n\n1. Run a migration, for example, a [Drupal-to-Drupal](https://www.drupal.org/project/migrate_d2d) migration\nof Book and Page content from a Drupal 6 site.\n2. Backup the target site's database. These commands run \n    across many nodes so be sure to do a backup first.\n3. Add the source database to the $databases array in settings.php.\n4. Find the migration machine name. D2D generates a random \n    alpha-numeric machine name when you create a migration.\n5. Run the Drush command to construct book hierarchy:\n\n    drush mbspbh --dbconnection=[source database] --migration=[Migrate job machien name] --types=book,page\n    \n6. Run the command to process body text links:\n\n    drush minpil --migration=[migration machine name] --types=book,page\n    \n    This command outputs all of the links that get updated or not.\n    You should capture these to a text file or spreadsheet so you can\n    do a content audit.\n\nThe --dry-run=TRUE option will print out the set of links that will get\nchanged without saving the changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froblib%2Fmigrate_book_structure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froblib%2Fmigrate_book_structure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froblib%2Fmigrate_book_structure/lists"}