query($DB, "Insert Into $table (id, thread, author, subject, host, email, datestamp) Select id, thread, name, topic, host, email, datestamp from $old_table"); if($err=$q->error()){ echo "Query 1: ".$err."

"; } $q->query($DB, "Insert Into $table"."_bodies (id, thread, body) select id, thread, body from $old_table"); if($err=$q->error()){ echo "Query 2: ".$err."

"; } $q->query($DB, "Update $table set parent=thread where thread<>id"); if($err=$q->error()){ echo "Query 3: ".$err."

"; } $DB->nextid($table); $sSQL="Select max(id) as id from ".$table; $q->query($DB, $sSQL); $id=$q->field("id", 0); $sSQL="Replace into ".$table."_seq values ('', $id+1)"; $q->query($DB, $sSQL); echo 'Upgrade Complete. If you have not already done so, activate the forum in the admin and go!

'; } ?>

Enter the old table name: ">
Enter the new table name: ">
Help:
  • Before using this, add an empty forum using the admin.
  • The old table name is the name of the table from Phorum 1.x.
  • The new table name is the name you gave the admin for the new forum.
  • This script only works if both tables are in the same database.