0

Kunena migration: updating the points...

After our sucessful Kunena migration, I decided to tidy up a bit by updating the points to catch some minor stuff that was not covered by the migration.

 

I wanted to update all migrated users points with some of their legacy Kunena activity as follows

Previous forum post = 1 point

Previous forum reply = 1 point

Previous Thank-You given = 3 points

Previous Thank-You received = 11 points

 

so I applied these queries ...

 

( In the queries below - JXX = 'your joomla db prefix')

 

UPDATE `JXX_cjforum_users`,`JXX_kunena_users` SET JXX_cjforum_users.points= JXX_cjforum_users.points+ (JXX_kunena_users.thankyou * 11) WHERE JXX_cjforum_users.id = JXX_kunena_users.userid

--query above is one time thankyou received points update after migration

 

 

UPDATE `JXX_cjforum_users`,`JXX_kunena_users` SET JXX_cjforum_users.points= JXX_cjforum_users.points + ((SELECT count(*) FROM `JXX_kunena_thankyou` where `userid` = JXX_kunena_users.userid)*3) WHERE JXX_cjforum_users.id = JXX_kunena_users.userid

--query above is one time thankyou given points update after migration

 

 

UPDATE `JXX_cjforum_users`,`JXX_kunena_users` SET JXX_cjforum_users.points= JXX_cjforum_users.points + (SELECT count(*) FROM `JXX_kunena_messages` WHERE parent<>0 AND `userid` = JXX_kunena_users.userid) WHERE JXX_cjforum_users.id = JXX_kunena_users.userid

--query above is one time reply post points update after migration

 

 

UPDATE `JXX_cjforum_users`,`JXX_kunena_users` SET JXX_cjforum_users.points= JXX_cjforum_users.points + (SELECT count(*) FROM `JXX_kunena_topics` WHERE `first_post_userid` = JXX_kunena_users.userid) WHERE JXX_cjforum_users.id = JXX_kunena_users.userid

--query above is one time initial post points update after migration

 

( Obviously my assigned point values are chosen arbitrarily, but maybe you can incorporate something like this into future Kunena migration code) ?

 

 

 

MICHAEL WALKERMICHAEL WALKER shared this idea  .  2 years ago
Maverick commented  .  2 years ago

Thank you for posting the scripts.

These are one-time migration queries which can be executed by anyone and are very specific to every forum. Since we cannot develop such migration scripts generic to all forums, I am closing this idea. However, it might be very helpful to someone who need similar migration.

/suggest-an-idea/cjforum.html /suggest-an-idea/cjforum.html