So, I have an sql guru at my office that I spoke to a bit this morning. He thinks it's doable but not all in native sql. I'm still thinking this process through. Bear with me, My thinking is it will need to happen external to the db with a wrapper script, (I've done this in Perl), likely on a per record iteration.
- find each post with a pb link(easy) and parse the image link(easy)
- download the image to local gallery (where failure may occur as pb is slow or throttling, broken links, etc.) and store the new reference (not hard)
the updates to the production table are where I'm still thinking through it. Inserting the new url link into the old body text is the trick I think, especially posts that have multiple pb links...
sql doesn't have much in the way of regex natively, that's why I think Perl. Maybe parse the body field into an array, splitting in IMG tags...
- find each post with a pb link(easy) and parse the image link(easy)
- download the image to local gallery (where failure may occur as pb is slow or throttling, broken links, etc.) and store the new reference (not hard)
the updates to the production table are where I'm still thinking through it. Inserting the new url link into the old body text is the trick I think, especially posts that have multiple pb links...
sql doesn't have much in the way of regex natively, that's why I think Perl. Maybe parse the body field into an array, splitting in IMG tags...