Merge the PET & 128 forums

Started by Blacklord, August 15, 2008, 12:18 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Blacklord

Some time back I mentioned that I planned on doing this - the time has come :)

On my test machine I've successfully managed to do it. There is of course, a caveat.

If the same user exists on both forums I need to delete the member out of the forum to be merged (the PET one in this case). No big deal, as they already exist in the to forum (the 128 one).

However, without a large amount of manual work the users PET board posts won't count towards their post count on the new merged board. Is this a problem for anyone ?

Lance

Blacklord

Oh yeah - how does a rename of the combined forums sound & what would you guys like it to be called ?

Andrew Wiskow

Since you have forums covering a variety of Commodore computers here already, why not just call the merged forums "Commodore Alive!"?

-Andrew
Cottonwood BBS & Cottonwood II
http://cottonwood.servebbs.com

Blacklord

Quote from: Andrew Wiskow on August 15, 2008, 12:41 PM
Since you have forums covering a variety of Commodore computers here already, why not just call the merged forums "Commodore Alive!"?

-Andrew

I was thinking that actually!

Golan Klinger

Quote from: Blacklord on August 15, 2008, 12:18 PM
If the same user exists on both forums I need to delete the member out of the forum to be merged (the PET one in this case). No big deal, as they already exist in the to forum (the 128 one).

So what happens to their posts?

QuoteHowever, without a large amount of manual work the users PET board posts won't count towards their post count on the new merged board. Is this a problem for anyone ?

I don't care about the post count so much as the loss of the posts (if that is an issue). Even if the posts are still available, if they're not under the user name of the person who made them then username-based searches become impossible. Another issue is that it becomes more difficult for people to contact people that said things (I can elaborate if you don't know what I mean). Are you sure there is no relatively easy way to combine things?
Call me Golan; my parents did.

airship

I can't even remember if I have an account on the PET forums, but I think I do. So no issues for me, other than the fact that I'm pretty much a C128-only fan. The other stuff is interesting to me, though.
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

Blacklord

Quote from: Golan Klinger on August 15, 2008, 05:47 PM
Quote from: Blacklord on August 15, 2008, 12:18 PM
If the same user exists on both forums I need to delete the member out of the forum to be merged (the PET one in this case). No big deal, as they already exist in the to forum (the 128 one).

So what happens to their posts?

QuoteHowever, without a large amount of manual work the users PET board posts won't count towards their post count on the new merged board. Is this a problem for anyone ?

I don't care about the post count so much as the loss of the posts (if that is an issue). Even if the posts are still available, if they're not under the user name of the person who made them then username-based searches become impossible. Another issue is that it becomes more difficult for people to contact people that said things (I can elaborate if you don't know what I mean). Are you sure there is no relatively easy way to combine things?

Posts are kept - not a problem there.

The posts can be relinked to a poster manually (that's why I mentioned the large chunk of manual work). And this would only affect posts were the username is duplicated on both boards. Obviously existing posts<>user links on the target board (this one) aren't affected, just the duplicte imports.

Lance

hydrophilic

It does sound like a bit of work, but you shouldn't need a lot of manual effort.  The important thing would be to determine which user_id's need to be updated in the old posts being imported.  Assuming you had the User tables for both forums in the same database, you could create a table for mapping:

Duplicates
----------
c128_id, pet_id, pet_posts

Populate the table with (psudo)code like:

q128 = SQL("select id, username from users;")
for each r128 in q128 {
  qPET = SQL("select id, num_posts from pet_users where username='" . r128.username . "';")
  if qPET.record_count == 0 then continue
  rPET = qPET.first_record
  s = "insert into duplicates (c128_id, pet_id, pet_posts) values (" . r128.id . "," . rPET.id . "," . rPET.num_posts . ");"
  SQL_execute(s)
}

To get the PET table of users into the 128 database you could use SQL statments but if you're using MySQL with MyISAM tables, you can simply copy the files representing the Users table (changing the table name to "pet_users" in the process with a simple file rename)

Creating the table of duplicates would be the "hard" part.  Of course the above needs to modified appropriately for your coding language and the structure of your database.

The "easy" part would be to make 2 loops over this table.  In one loop you would take the old user_id and update all incoming posts with that id to the new id.  In the second loop you add the number of posts from the PET database to the number of posts in the C128 database.  Or do both in the same loop I suppose:

qDup = SQL("select c128_id, pet_id, pet_posts from Duplicates;")
for each rDup in qDup {
  s = "update PET_posts set id = " . rDup.c128_id . " where id = " . rDup.pet_id . ";"
  SQL_execute(s)
  s = "update users set num_posts = num_posts + " . rDup.num_posts . " where id = " . rDup.c128_id . ";"
  SQL_execute(s)
}

One problem I foresee is that users that are unique in the PET database might have a user_id that already exists in the c128 database... but it sounds like you've already got that worked out.  If not, posts from the PET database would be attributed to unrelated members in c128 database.

If you're using MySQL and PHP, I could write and test some code if you like.  PM if you're interested.  I would need to know which MySQL and PHP versions you use and the structure of the database (only relevent tables).

Another problem I just thought of is links to users contained in posts.  I don't know how they work.  If they use the same user_id in the link I guess you would need to do an SQL search with a LIKE qualifier and then use some code to re-write the text of the post.

Sounds like a can of worms!  Your idea to not bother is sounding better now...