This custom Drupal module provides functionality to recursively fetch pages from a fake endpoint and store them into the cascade_pages
database table. It includes services for handling HTTP requests, storing data, and managing recursive fetching.
- Recursively fetch pages from a specified endpoint.
- Store fetched pages into the
cascade_pages
database table. - Logging of fetch and storage operations.
-
Place the
custom_migration
module in themodules/custom
directory of your Drupal installation. -
Enable the module using Drush:
drush en custom_migration
-
Run the command
drush cmu_cascade:fetch-pages
Wait and you'll get all content migrated successfully.
To extend the functionality of this module, you can add new services or modify existing ones. Take for example the existing migration class CMULandingPageMigrationService, change its name to for example CMUBlogPostMigrationService and make sure in the factory class you call for instance:
public function getService($page_type) {
switch ($page_type) {
case 'article':
return new CMUArticleMigrationService($this->logger);
case 'landing_page':
return new CMULandingPageMigrationService($this->logger);
// HERE GOES YOUR CUSTOM CLASS FOR A NEW MIGRATION.
case 'blog'
return new CMUBlogPostMigrationService($this->logger);
// Add more cases for different page types.
}
}
- See the following jira epic ticket https://cascade-example.atlasian.com/JIRA-CASCADE-5 for more context
- See the following documentation in paperDropbox https://paperdropbox/ahshsa/CASCADE-MIGRATION-TO-DB
- Ask in slack @cmu-dev and team members will be happy to follow-up to help.