UBB.Dev
Posted By: Myke SQL to move threads in bulk? - 10/02/2003 7:05 AM
I'd like to move every thread from one board to another that matches a certain string in the Subject. The SQL command would be something like:

UPDATE w3t_Posts
SET B_Board = 'newboard'
WHERE B_Board = 'oldboard'
AND B_Subject LIKE '%string%'

But then looking at the domovethreads script I realised it's much more involved than that (need to check favorites, etc). And actually, I realised that if a post within a thread has its subject changed such that it won't match the 'string' then that post won't be moved, resulting in a broken thread.

So, I'm after any suggestions on how to go about moving threads in bulk based on some criteria?

I'm using version 6.2.3.

Cheers.
Posted By: JoshPet Re: SQL to move threads in bulk? - 10/02/2003 7:37 AM
Yeah, you can't just move things.... or you'd get strange results for sure.

You'd need a script that would cycle through all the subjects, and when it finds the string you're looking for, move all the threads to the appropriate forum.

Number of threads/posts would need to be adjusted in the w3t_Boards table as well, and as you noticed, there are some other bits (like favorites etc..) that need to be updated.

There is a mass move threads mod here - but you'd have to individually select each thread.
Posted By: Myke Re: SQL to move threads in bulk? - 10/02/2003 7:44 AM
Thanks Josh. I'll look into that mod. Individually selecting all the threads and then hitting a fat move button is infinitely more tolerable than having to individually move one thread at a time.
Posted By: Myke Re: SQL to move threads in bulk? - 10/02/2003 8:00 AM
Sorry to ask here, since this isn't SQL related anymore, but the mass move mod has been updated for .threads 6.3. Will there be any issues using it for 6.2.3?
Posted By: Dave_L_dup1 Re: SQL to move threads in bulk? - 10/02/2003 7:01 PM
It would be better to ask that in the thread for that mod.
Posted By: JoshPet Re: SQL to move threads in bulk? - 10/02/2003 7:22 PM
There's an older post for a 6.2 version under Archived Modifications
https://www.ubbdev.com/forum/showflat.php?Cat=0&Board=beta&Number=84985
© UBB.Developers