I figured it out, but it was a bit of work.
First, I ran an update mybb_posts.uid
UPDATE mybb_posts p
JOIN mybb_users u ON BINARY TRIM(p.username) = BINARY TRIM(u.username)
SET p.uid = u.uid
WHERE p.uid != u.uid;
Second, I ran a query to update mybb_threads.uid
UPDATE mybb_threads t
JOIN mybb_posts p ON t.tid = p.tid AND t.dateline = p.dateline
SET t.uid = p.uid
WHERE t.uid = 0;
Third, I ran a query to update mybb_threads.lastposteruid
UPDATE mybb_threads t
JOIN mybb_posts p ON t.tid = p.tid AND TRIM(t.lastposter) = TRIM(p.username)
SET t.lastposteruid = p.uid
WHERE t.lastposteruid = 0;
Then I went into MyBB Admin CP → Tools & Maintenance → Recount & Rebuild and ran these tools:
1. Rebuild Thread Counters
2. Rebuild Forum Counters
3. Recount Statistics
I was looking at the mybb_privatemessages table, and uid, toid, and fromid are all showing the old Invision user id's. However, there were no names associated with any of these fields. I noticed that the myBB board had the uid start at 50 for all members except for the admin account, which had a uid of 1 (The board is a private family board with ~40 members). I ran a query in the invision database that pulled the memberid and name from the table ibf_members. I then ran a query in mybb_users to pull the uid and username. I put both lists into excel and did an xlookup to create a table with uid, username, and memberid. I put that into a temp table called temp_pm_map:
CREATE TABLE temp_pm_map (
old_id INT,
username VARCHAR(255),
new_id INT
);
INSERT INTO temp_pm_map (old_id, username, new_id) VALUES
(1, 'Admin', 1),
(5, 'JaneDoe', 50),
(12, 'JohnSmith', 51)
...;
I ran the following queries to update mybb_privatemessages and drop the temp table
-- 1. Update the 'uid' (the folder owner)
UPDATE mybb_privatemessages pm
JOIN temp_pm_map map ON pm.uid = map.old_id
SET pm.uid = map.new_id;
-- 2. Update the 'toid' (the recipient)
UPDATE mybb_privatemessages pm
JOIN temp_pm_map map ON pm.toid = map.old_id
SET pm.toid = map.new_id;
-- 3. Update the 'fromid' (the sender)
UPDATE mybb_privatemessages pm
JOIN temp_pm_map map ON pm.fromid = map.old_id
SET pm.fromid = map.new_id;
DROP TABLE temp_pm_map;
Then I went into MyBB Admin CP → Tools & Maintenance → Recount & Rebuild and ran these tools:
1. Rebuild Recount Private Messages
2. Recount Statistics
Unfortunately, I could not see a log file anywhere showing what happened when the merge occurred. I'm not sure if there was a setting somewhere I should have enabled but didn't, but I've looked and can't find anything.
I also had IP.Gallery installed on my old board. That did not move over. It was a bit of work, but I was able to was able to create a page that linked to the folders containing the uploaded images (which I left in the old Invision uploads directory). Unfortunately, anything that was posted inside that module giving commentary on the pictures hasn't been added, as I haven't had time to muck around with it. It isn't pretty, but at least people have access to the pictures.