Blog migration review
Initial commit for drumm's review to see if this is the right direction and make the review process easier with MR tools.
Merge request reports
Activity
- Resolved by Brendan Blaine
- Resolved by Neil Drumm
- Resolved by Brendan Blaine
- Resolved by Neil Drumm
- Resolved by Neil Drumm
- Resolved by Neil Drumm
added 1 commit
- 02496c86 - Suggestion from Neil, check for promote to front page instead of node type...
added 1 commit
- c84e0f08 - Changing structure, query names for clarity, uid finding
- Resolved by Neil Drumm
- Resolved by Neil Drumm
added 1 commit
- eef39912 - Refactored how comments attach to blog data in both logic and structure
This looks all good for now. I'll hold off on merging, since developing the import will be a good way to find something we didn't think about.
Files are the next thing to think about migrating, a good number of these have images attached. To start, maybe add the array of public URLs of the files to the export, like
https://assoc.drupal.org/files/Drupal8Mens_1.png
for https://assoc.drupal.org/blog/eliseh1280/buy-gift-drupalWe can copy the files over on a batch server, so the actual files don't need to be transferred. That post does have
<img alt="" src="https://assoc.drupal.org/files/Drupal8Mens_1.png"
, so at least the domain name will have to be taken out. If there are a lot of collisions, we might put them in a subdirectory like/files/association-archive/Drupal8Mens_1.png
. Can think about that once we have a list and see what there is.added 1 commit
- 99af5a7e - Create a list of image urls from blog body content and export the list so we...
Thanks so much Neil. On dev I've found 598 images, mostly from assoc.drupal.org but there are quite a few from other places. I'll commit the code I used to get the list here shortly.
edit: I hit push before I'd clicked "comment"
Edited by Brendan Blaine70 $comment_nodes = comment_load_multiple(array_keys($comment_result['comment'])); 71 72 $blog_data = []; 73 foreach (node_load_multiple(array_keys($result['node'])) as $nid => $blog) { 74 if ($blog->status == 1) { 75 $blog_data[$nid]['title'] = $blog->title; 76 $blog_data[$nid]['name'] = $blog->name; 77 $blog_data[$nid]['created'] = $blog->created; 78 $blog_data[$nid]['changed'] = $blog->changed; 79 $blog_data[$nid]['body'] = $blog->body[LANGUAGE_NONE][0]['value']; 80 if(!empty($blog->upload)) { 81 $blog_data[$nid]['files'] = $blog->upload; 82 } 83 84 // Extract all image urls from the body and put them in an array 85 $regex = '/https?:\/\/[^"\']+\.(?:jpg|jpeg|gif|png|webp|svg)/i'; changed this line in version 10 of the diff