XF 2.2 Replacing posts with posts from backup

duderuud

Well-known member
I ran a certain add-on but it replaced not only bad urls but also good ones, I don't know if it's user error or the add-on but anyway...

If I would import a backup as a "mirror db" on the same server, would there be a query that could replace all posts from the love db with a specific phrase with posts (with the exact same id etc) from the mirror db?

If someone can help me with that, I would be forever grateful.
 
it's a bit easier if you upload just a xf_post_backup table, and not a whole other database.

I don't have time to write it out, but general concept would be
- find the postids of effected rows.
run an update select with the join where postid IN(the list of postid's (can be a subquery))

 
it's a bit easier if you upload just a xf_post_backup table, and not a whole other database.
Yeah, that is way more efficient. Thanks for the tip.
I don't have time to write it out, but general concept would be
- find the postids of effected rows.
run an update select with the join where postid IN(the list of postid's (can be a subquery))
I'm not confident enough to do that myself. If someone can do that for me, that would be great. A free beer (or 20) for someone that can 😉

Oh, and we are talking about millions of posts in total so the query must be able to run with low priority or something without timing out or exhaust server resources (fast dedicated server with 128gb of mem).
 
Back
Top Bottom