<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Merge two phorums as one</title>
        <description> I want to combine two historically separate forums as one.

I think I know how to slog through this with a perl DBI script and command line sql.
Select several columns from phorum_messages, from both databases, as needed. First one then the other.  

Store each message in a file whose name is the original datestamp post date. First line author_id. Second line data.  Third line etc whatever else might be needed. I&amp;#039;d have to look more carefully at phorum_messages.

Prepare a new database as a copy of the bigger of the two originals.
Now delete * from phorum_messages (now you have phorum_users etc, as they are needed).

Make a list file names (which are same as datestamp) as a text file list sorted by date (sorted by file name, which is datestamp).
Read each such file in a loop.  Bust it up into an array of values.
Insert one by one, into the new database name.  
I&amp;#039;m probably missing something but it seems quite doable.

Is there a utility or plugin to do this without the all-day slog?</description>
        <link>https://www.phorum.org/support/read.php?61,161991,161991#msg-161991</link>
        <lastBuildDate>Mon, 12 Oct 2026 13:01:19 -0500</lastBuildDate>
        <generator>Phorum 6.0.4</generator>
        <item>
            <guid>https://www.phorum.org/support/read.php?61,161991,162148#msg-162148</guid>
            <title>Re: Merge two phorums as one</title>
            <link>https://www.phorum.org/support/read.php?61,161991,162148#msg-162148</link>
            <description><![CDATA[ Get a list of thread heads from both forums sorted by date<br />
select * from phorum_messages where parent_id = 0 and (forum_id = $x or forum_id = $y) order by datestamp;<br />
<br />
loop through with perl dbi or its equivalent in some other language<br />
<br />
make a hashed data structure of some kind that includes a new (blank for now) field called new_message_id;<br />
loop through the data structures and write them to a well-formatted file, where the name of each file is the message_id<br />
<br />
loop through the data structure inserting to a new database sorted by datestamp.<br />
For each such insert update the data structure&#039;s new_message_id with the new one, just now retrieved from the previous insert<br />
<br />
for each (thread head) datastructure<br />
{<br />
  select * from phorum_messages where thread = datastructure.message_id order by datestamp;<br />
  make another hashed datastructure<br />
  for each response_structure insert into new database using new_message_id<br />
}<br />
<br />
That could be made to work.  How badly do I want this?]]></description>
            <dc:creator>salmobytes</dc:creator>
            <category>Phorum Support</category>
            <pubDate>Sat, 27 Oct 2018 10:11:25 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?61,161991,161991#msg-161991</guid>
            <title>Merge two phorums as one</title>
            <link>https://www.phorum.org/support/read.php?61,161991,161991#msg-161991</link>
            <description><![CDATA[ I want to combine two historically separate forums as one.<br />
<br />
I think I know how to slog through this with a perl DBI script and command line sql.<br />
Select several columns from phorum_messages, from both databases, as needed. First one then the other.  <br />
<br />
Store each message in a file whose name is the original datestamp post date. First line author_id. Second line data.  Third line etc whatever else might be needed. I&#039;d have to look more carefully at phorum_messages.<br />
<br />
Prepare a new database as a copy of the bigger of the two originals.<br />
Now delete * from phorum_messages (now you have phorum_users etc, as they are needed).<br />
<br />
Make a list file names (which are same as datestamp) as a text file list sorted by date (sorted by file name, which is datestamp).<br />
Read each such file in a loop.  Bust it up into an array of values.<br />
Insert one by one, into the new database name.  <br />
I&#039;m probably missing something but it seems quite doable.<br />
<br />
Is there a utility or plugin to do this without the all-day slog?]]></description>
            <dc:creator>salmobytes</dc:creator>
            <category>Phorum Support</category>
            <pubDate>Fri, 04 May 2018 15:15:18 -0500</pubDate>
        </item>
    </channel>
</rss>
