Featured image not working after migrate db from standard wp installation to trellis/bedrock/sage setup

I am building a new website with the roots trellis, bedrock, sage stack. Great. Happy.
I have copied the uploads folder across from the standard wp installation to the roots installation (/site/web/app/uploads) and used migrate db pro to copy all the wp tables across to duplicate the existing site. I used migrate db pro to search and replace the wp image paths and the images are showing up in my media library. Fantastic.
However, when I try and add an image to a post or page using the featured image widget I can select the image but it does not show up in the post (in the editor).
If I upload a new image, I can select it AND it shows up in the featured image block in the editor.
I do not know why this is. Any suggestions or fixes?

When you select the broken image, can you see the image path? Does it link to wp-content still?

Maybe try WP-CLI to do a wp db search to make sure there’s nothing left over?

I can see the image thumnail in the image library but when I click it I can’t see the image even though the path to the image appears to be correct /app/uploads/etc

and I did check in the specified folder to make sure the image is actually there.

When I do wp db search wp-content:

wp_options:option_value
223:[{"replace_old":"https://saharvest.test/wp-content/uploads","replace_new":"/app/uploads"," [...] [{"replace_old":"https://saharvest.test/wp-content/uploads","replace_new":"/app/uploads","
wp_options:option_value
973:/"><img src="https://cdn.poststatus.com/wp-content/uploads/2021/09/vertical-post-status-lo [...] t="752" src="https://cdn.poststatus.com/wp-content/uploads/2022/11/ab58aa31afffd4af6284f42 [...] c="https://i0.wp.com/gutenbergtimes.com/wp-content/uploads/2022/10/IMG_4949-scaled.jpg?w=6 [...] /"><img src="https://cdn.poststatus.com/wp-content/uploads/2021/09/vertical-post-status-lo [...] o"><img src="https://cdn.poststatus.com/wp-content/uploads/2022/01/gdpro800x500-1-300x188. [...] o"><img src="https://cdn.poststatus.com/wp-content/uploads/2022/01/gdpro800x500-1-300x188. [...] height="512" src="https://heropress.com/wp-content/uploads/2023/10/102522-min.jpeg" class= [...] t="132" src="https://cdn.poststatus.com/wp-content/uploads/2022/06/WPVIPlogo-1-300x132.web [...] t="419" src="https://cdn.poststatus.com/wp-content/uploads/2022/10/Screen-Shot-2022-10-21-
wp_posts:post_content
6:;
}
.iframe-loading {
        background:url("/wp-content/themes/Divi/images/loading.gif") center
wp_posts:post_content
655:g 2560w, http://saharvest.test/dev-site/wp-content/uploads/2020/05/SA_HARVEST_RVR_2020-19- [...] pg 300w, http://saharvest.test/dev-site/wp-content/uploads/2020/05/SA_HARVEST_RVR_2020-19- [...] g 1024w, http://saharvest.test/dev-site/wp-content/uploads/2020/05/SA_HARVEST_RVR_2020-19- [...] pg 768w, http://saharvest.test/dev-site/wp-content/uploads/2020/05/SA_HARVEST_RVR_2020-19- [...] g 1536w, http://saharvest.test/dev-site/wp-content/uploads/2020/05/SA_HARVEST_RVR_2020-19- [...] g 2048w, http://saharvest.test/dev-site/wp-content/uploads/2020/05/SA_HARVEST_RVR_2020-19- [...] g 1200w, http://saharvest.test/dev-site/wp-content/uploads/2020/05/SA_HARVEST_RVR_2020-19-
wp_posts:post_content
9344:t;
}
.iframe-loading {
        background:url(/wp-content/themes/Divi/images/loader.gif) center c
wp_posts:post_content
9346:t;
}
.iframe-loading {
        background:url(/wp-content/themes/Divi/images/loading.gif) center 
wp_posts:post_content
9469:;
}
.iframe-loading {
        background:url("/wp-content/themes/Divi/images/loading.gif") center
wp_posts:post_content
9969:ll" src="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png" sizes=" [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png 646w, ht [...] ng 646w, https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay-300x116.png  [...] ll" src="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png" sizes="(m [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png 512w, http [...] ng 512w, https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore-300x121.png 30
wp_posts:post_content
9815:ll" src="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png" sizes=" [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png 646w, ht [...] ng 646w, https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay-300x116.png  [...] ll" src="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png" sizes="(m [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png 512w, http [...] ng 512w, https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore-300x121.png 30
wp_posts:post_content
9818:l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png" sizes=" [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png 646w, ht [...] ng 646w, https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay-300x116.png  [...] l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png" sizes="(m [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png 512w, http [...] ng 512w, https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore-300x121.png 30
wp_posts:post_content
9841:l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png" sizes=" [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png 646w, ht [...] ng 646w, https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay-300x116.png  [...] l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png" sizes="(m [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png 512w, http [...] ng 512w, https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore-300x121.png 30
wp_posts:post_content
9842:l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png" sizes=" [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png 646w, ht [...] ng 646w, https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay-300x116.png  [...] l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png" sizes="(m [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png 512w, http [...] ng 512w, https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore-300x121.png 30
wp_posts:post_content
9843:l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png" sizes=" [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png 646w, ht [...] ng 646w, https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay-300x116.png  [...] l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png" sizes="(m [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png 512w, http [...] ng 512w, https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore-300x121.png 30
wp_posts:post_content
9844:l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png" sizes=" [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png 646w, ht [...] ng 646w, https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay-300x116.png  [...] l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png" sizes="(m [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png 512w, http [...] ng 512w, https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore-300x121.png 30
wp_posts:post_content
9845:l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png" sizes=" [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png 646w, ht [...] ng 646w, https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay-300x116.png  [...] l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png" sizes="(m [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png 512w, http [...] ng 512w, https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore-300x121.png 30
wp_posts:post_content
9846:l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png" sizes=" [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay.png 646w, ht [...] ng 646w, https://colabfoundation.org.za/wp-content/uploads/2020/09/googleplay-300x116.png  [...] l " src="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png" sizes="(m [...]  srcset="https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore.png 512w, http [...] ng 512w, https://colabfoundation.org.za/wp-content/uploads/2020/09/appstore-300x121.png 30
wp_posts:post_content
9942:file /srv/www/saharvest.org/current/web/wp-content/plugins/woocommerce-pdf-vouchers/includ [...] " in /srv/www/saharvest.org/current/web/wp-content/plugins/woocommerce-pdf-vouchers/includ [...] :
#0 /srv/www/saharvest.org/current/web/wp-content/plugins/woocommerce-pdf-vouchers/includ
wp_posts:post_content
9943:file /srv/www/saharvest.org/current/web/wp-content/plugins/woocommerce-pdf-vouchers/includ [...] " in /srv/www/saharvest.org/current/web/wp-content/plugins/woocommerce-pdf-vouchers/includ [...] :
#0 /srv/www/saharvest.org/current/web/wp-content/plugins/woocommerce-pdf-vouchers/includ
wp_posts:post_content
9944:file /srv/www/saharvest.org/current/web/wp-content/plugins/woocommerce-pdf-vouchers/includ [...] " in /srv/www/saharvest.org/current/web/wp-content/plugins/woocommerce-pdf-vouchers/includ [...] :
#0 /srv/www/saharvest.org/current/web/wp-content/plugins/woocommerce-pdf-vouchers/includ
wp_posts:post_content
9945:file /srv/www/saharvest.org/current/web/wp-content/plugins/woocommerce-pdf-vouchers/includ [...] " in /srv/www/saharvest.org/current/web/wp-content/plugins/woocommerce-pdf-vouchers/includ [...] :
#0 /srv/www/saharvest.org/current/web/wp-content/plugins/woocommerce-pdf-vouchers/includ

I can’t see anything that would obviously break the image path of the migrated images unless it’s in this line:

223:[{"replace_old":"https://saharvest.test/wp-content/uploads","replace_new":"/app/uploads"," [...] [{"replace_old":"https://saharvest.test/wp-content/uploads","replace_new":"/app/uploads","
wp_options:option_value

I think the image path needs to include the domain. Judging by that last line, it looks like you replaced it with just /app/uploads unless I’m mistaken.

2 Likes