News:

Wondering if this will always be free?  See why free is better.

Main Menu

Converting from Phorum

Started by kltid, March 06, 2009, 07:22:18 AM

Previous topic - Next topic

kltid

I'm trying to convert but I get the message

The error MySQL gave was: Access denied for user 'smf'@'192.168.0.%' to database 'phorum'

Both databases are on the same server

ThorstenE

the MySQL user for both databases must be the same. SMF  needs at least read access to your phorum database

kltid

Is the a simple patch/edit to overcome the need to have the same user on both databases.
My hosting company refuses to give one user access to both database "for security reasons"

ThorstenE

You also can use the same database for SMF and Phorum without issues. All SMF tables use a table prefix (default is smf_) .

kltid

All looking good apart from the conversion of PM's which gives
Converting personal messages (step 1)... Unsuccessful!
This query:
    SELECT
    p.private_message_id AS ID_PM, p.from_user_id AS ID_MEMBER_FROM,
    p.datestamp AS msgtime,
    SUBSTRING(IFNULL(u.username, p.from_username), 1, 255) AS fromName,
    SUBSTRING(p.subject, 1, 255) AS subject,
    SUBSTRING(p.message, 1, 255) AS body, p.from_del_flag AS deletedBySender
    FROM `phorum`.phorum_private_messages AS p
    LEFT JOIN `phorum`.phorum_users AS u ON (u.user_id = p.from_user_id)
    LIMIT 0, 500;

Caused the error:

    Table 'phorum.phorum_private_messages' doesn't exist

Anyone seen this before?
I assume the answer is - find out the name of the table in Phorum version 5.1.15 and edit the convert.php file - unfortunately I don't know the first or how to do the second.

ThorstenE

can you check your phorum database with phpMyAdmin? maybe there is a table named priv_messages or similar?

kltid

The relevant tables appear to be:
phorum_pm_messages
phorum_pm_buddies
phorum_pm_xref
phorum_pm_folders
there is also a phorum_messages

SleePy

Our converter was developed for Phorum 5.

I guess they changed this in 5.1

On the phorum_pm_messages,
Could you click Structure.
Then post or pm the Table that you get.

This is how the table is setup. This way I can know if they just changed the table name, or also the column names (and/or complicated things more).
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

evans.mutai

hi, sorry for my noob question but  what happens when i run the convert.php? does it overwrite files or does it back up and create new files?

ThorstenE

Our converter will copy the content (users, Posts, topics..) from your Phorum to a fresh installed SMF.
Converting to SMF

evans.mutai

hi i got a problem while converting from phorum to smf
please help

heres the error log

Converting topics... Successful.
Converting posts (this may take some time)... Unsuccessful!
This query:

    INSERT INTO `forum`.smf_messages
    (ID_MSG, ID_TOPIC, posterTime, ID_MEMBER, SUBSTRING(m.subject, 1, 255), posterEmail, posterName, ID_BOARD, posterIP, body, modifiedName, icon)
    VALUES ('1', '1', '1196379009', '0', 'Test Message', '', 'Phorum Installer', '2', '127.0.0.1', 'This is a test message.

evans.mutai

then at the bottom of the error it says

Caused the error:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING(m.subject, 1, 255), posterEmail, posterName, ID_BOARD, posterIP, body,' at line 2

SleePy

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

hhouwaard

I tried this attachment because I ran into the same error. It gives the following result:

Converting...
Converting members...Unknown column 'memberName' in 'field list'

hhouwaard

Converting...
Converting members... Successful.
Converting categories... Successful.
Converting boards... Successful.
Converting topics... Successful.
Converting posts (this may take some time)... Successful.
Removing polls... Successful.
Converting personal messages (step 1)... Unsuccessful!
This query:

    SELECT
    p.pm [nofollow]_message_id AS id_pm, p.from_user_id AS id_member_from,
    p.datestamp AS msgtime,
    SUBSTRING(IFNULL(u.username, p.from_username), 1, 255) AS from_name,
    SUBSTRING(p.subject, 1, 255) AS subject,
    SUBSTRING(p.message, 1, 255) AS body, p.from_del_flag AS deleted_by_sender
    FROM `CN20050958_rock`.phorum_pm_messages AS p
    LEFT JOIN `CN20050958_rock`.phorum_users AS u ON (u.user_id = p.from_user_id)
    LIMIT 0, 500;

Caused the error:

    Unknown column 'p.from_user_id' in 'field list'

This error is the result of a completely different setup for the private messages tables. If anyone can help me out getting the phorum_to_smf.sql file setup correctly I would be most greatful.

Hans

Oldiesmann

If you can give us the structure of your table, we can probably get things sorted out for you.
Michael Eshom
Christian Metal Fans

hhouwaard

#16
phorum_pm_messages table
     Veld        Type        Collatie     AttributNullStandaar      Extra
pm_message_id int(10)                     UNSIGNEDNee Geen    AUTO_INCREMENT
   user_id    int(10)                     UNSIGNEDNee        0
    author    varchar(255utf8_general_ci          Nee
   subject    varchar(100utf8_general_ci          Nee
   message    text       utf8_general_ci          Nee Geen
  datestamp   int(10)                     UNSIGNEDNee        0
     meta     mediumtext utf8_general_ci          Nee Geen


hhouwaard

phorum_pm_xref table structure
         Veld              Type        Collatie     Attribut  Null  Standaar Extra
      pm_xref_id       int(10)                      UNSIGNEDNee     Geen    AUTO_INCREMENT
        user_id        int(10)                      UNSIGNEDNee            0
     pm_folder_id      int(10)                      UNSIGNEDNee            0
    special_folder     varchar(10) utf8_general_ci          Ja      NULL
     pm_message_id     int(10)                      UNSIGNEDNee            0
       read_flag       tinyint(1)                           Nee            0
      reply_flag       tinyint(1)                           Nee            0


hhouwaard

porum_pm_folders table structure
    Veld     Type CollatiAttributNullStandaar      Extra
pm_folder_idint(10)      UNSIGNEDNee Geen    AUTO_INCREMENT
  user_id   int(10)      UNSIGNEDNee        0

hhouwaard

phorum_pm_buddies table structure
        Veld          Type  CollatieAttribut  Null  Standaar Extra
    pm_buddy_id     int(10)         UNSIGNEDNee     Geen    AUTO_INCREMENT
      user_id       int(10)         UNSIGNEDNee            0
   buddy_user_id    int(10)         UNSIGNEDNee            0

Oldiesmann

Ok. Is the "xref" table the one that contains information about the person who sent the message?
Michael Eshom
Christian Metal Fans

hhouwaard

I have look at the content in the tables and it seems to me to be like this:

phorum_pm_messages contains the messages, together with the sender id, (author id and author name). With the message_id you can lookup the rest of the information on the private message in the xref table, where the user_id signifies the receiver. Here read, reply and folder information is kept. So you need a join of these 2 tables to have all needed information to convert to smf.

Hope this helps,

Hans

Oldiesmann

Ok. Should be pretty easy to fix then. Which sql file were you using with convert.php?
Michael Eshom
Christian Metal Fans

hhouwaard

I tried both the phorumtosmf.sql included with the converter package and the phorumtosmf.sql file included with this thread. Both give errors with wrong table names etc.

Thanks,

Hans

sveneld

Here it is fixed version for converting

hhouwaard

There are a lot of error in the table name for SMF itself in this file. Lots of tables have capitals for names which are lowercase and some have tableField where it should be table_field.

I have tried to correct the sql file for this, I now get this response:
Converting...
Converting members... Successful.
Converting categories... Successful.
Converting boards... Successful.
Converting topics... Successful.
Converting posts (this may take some time)... Successful.
Removing polls... Successful.
Converting personal messages (step 1)... Successful.
Converting personal messages (step 2)...Duplicate entry '653-6' for key 'PRIMARY'

sveneld

Quote from: hhouwaard on October 29, 2011, 01:09:29 PM
There are a lot of error in the table name for SMF itself in this file. Lots of tables have capitals for names which are lowercase and some have tableField where it should be table_field.
I haven't receive any error when use this script. I work with clear installed versions of Phorum and SMF, possibly you have made changes in your tables. Or you use it with SMF version 2.0 instance of SMF 1.1.15

Quote from: hhouwaard on October 29, 2011, 01:09:29 PM
I have tried to correct the sql file for this, I now get this response:
Converting...
Converting members... Successful.
Converting categories... Successful.
Converting boards... Successful.
Converting topics... Successful.
Converting posts (this may take some time)... Successful.
Removing polls... Successful.
Converting personal messages (step 1)... Successful.
Converting personal messages (step 2)...Duplicate entry '653-6' for key 'PRIMARY'

This error is going from php file convert.php. They tried to recalculate some stats. But you can make this in smf.
After using this script I got all forums, messages and users in SMF.

hhouwaard

I do use Phorum 5.2.15 and SMF 2. So that could explain it. I will go and see if all users and messages indeed made the transfer to SMF. Thanks for the help!

Hans

Wualala

Please upgrade this converter to the last version of phorum!!!  the current version dont works!

Oldiesmann

Wualala, which version of Phorum are you using, and what problems are you experiencing with the current converter?
Michael Eshom
Christian Metal Fans

Advertisement: