SMF to s9y

Having trouble installing serendipity?
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

SMF to s9y

Post by 3nd3r »

Hello. I thought Ive posted this yesterday, but I've not found my post at all ??

So, my question is if it's possible to dump all posts and comments from my SMF into a s9y blog.

I'm sure there's a way to do it by SQL, but I'm not a code expert...

Please admins, if this message is posted in the wrong thread, consider moving it to correct place.

Thanks in advance for your time... I want to cease use SMF as soon as possible...
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: SMF to s9y

Post by garvinhicking »

Hi!

s9y has a phpbb import module. So if you know the SMF structure, you should be able to use that include/admin/importer/phpbb.inc.php file as a starting ground for an SMF importer.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Post by 3nd3r »

Thanks for your lightspeed answer! :wink:

Would you help me if I get catastrofic errors?

I think this could be useful to people who wants to migrate from SMF to s9y...

Thank you again!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Sure, I can try to help. But I've never used SMF, so I know nothing about their DB structure. :-)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Post by 3nd3r »

Well, here's the first question:

I've got my SMF blog under the www root, I mean

http://www.pajareo.com/index.php as the starting page

So, can I install s9y to, for example, http://www.pajareo.com/s9y/

then make the dump and then move the all s9y thing to WWW root?
Try not. Do, or do not. There is no try.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

You can do that, the FAQ on www.s9y.org also describes what you need to do when moving an installation. It's a bit of work, but quite easy and should be done in a matter of few minutes.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Post by 3nd3r »

Wooooshhh!!! Awesome answering time!... Are u trying to break an olympic record? :wink:

Ok! Let's go for it!

Geronimoooo !!!
Try not. Do, or do not. There is no try.
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Post by 3nd3r »

Well. Here's the first one:

Install went ok. I tried to import from phpBB, and this is the first error:

Code: Select all

Importación fallida: No se puede seleccionar la información del usuario: Table 'pajareo_smf.users' doesn't exist.
So, I open include/admin/importer/phpbb.inc.php and saw this:

Code: Select all

        /* Users */
        $res = @$this->nativeQuery("SELECT user_id       AS ID,
                                    username      AS user_login,
                                    user_password AS user_pass,
                                    user_email    AS user_email,
                                    user_website  AS user_url,
                                    user_level
                               FROM {$this->data['prefix']}users
                              WHERE user_active = 1", $gdb);
        if (!$res) {
            return sprintf(COULDNT_SELECT_USER_INFO, mysql_error($gdb));
        }

        for ($x=0, $max_x = mysql_num_rows($res); $x < $max_x ; $x++ ) {
            $users[$x] = mysql_fetch_assoc($res);

            $data = array('right_publish' => 1,
                          'realname'      => $users[$x]['user_login'],
                          'username'      => $users[$x]['user_login'],
                          'email'         => $users[$x]['user_email'],
                          'userlevel'     => ($users[$x]['user_level'] == 0 ? USERLEVEL_EDITOR : USERLEVEL_ADMIN),
                          'password'      => $users[$x]['user_pass']); // MD5 compatible

            if ($serendipity['serendipityUserlevel'] < $data['userlevel']) {
                $data['userlevel'] = $serendipity['serendipityUserlevel'];
            }

            serendipity_db_insert('authors', $this->strtrRecursive($data));
            echo mysql_error();
            $users[$x]['authorid'] = serendipity_db_insert_id('authors', 'authorid');
        }
Can you tell me how can I modify this block of code to the right import of users table? I can get this like an example of the next import tables...

Or, if you prefer, I can paste the pertinent table structure here or send it to you by PM...
Try not. Do, or do not. There is no try.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Yeah, you need to go through the script, find every occurence of "nativeQuery" and adapt the SQL queries to match the tables and field names of SMF.

See if SMF has a similar SQL DB structure like phpBB; if not, you will need to recreate most SQL queries.

I myself sadly do not have the time currently to analyze the SQL structure for you.

Regards,
GArvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Post by 3nd3r »

Thanks for your time.

I'm not a code expert on SQL, so, I'd like to know where do I have to substitute the phpBB tables and field names for SMF ones in the code. Just tell me like "here", and I'll begin to debug for myself

For the info I got, SMF tables are MyISAM type and SMF core code comes from YaBBSE... I don't know if this is or not more similar to phpBB...

Thank you again for your quick answer.
Try not. Do, or do not. There is no try.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Okay, investigate this line of code you already pasted:

Code: Select all

"SELECT user_id       AS ID,
                                    username      AS user_login,
                                    user_password AS user_pass,
                                    user_email    AS user_email,
                                    user_website  AS user_url,
                                    user_level
                               FROM {$this->data['prefix']}users
                              WHERE user_active = 1"
This SQL code means that Serendipity tries to access a database table of phpBB called "phpbb_users" (or whatever your prefix is). This table holds the fields "username", "user_password" and so forth.

Now you need to locate the database table name of SMF in which the users are stored and map the appropriate keys. Like if the username there is stored in "loginname" you would need to change that piece of code above to read "loginname AS user_login". Always keep the things after "AS ..." as they read before now, so that you do not have to change much more than just the SQL query.

Now you need to go through the code, find every mention of a phpBB database table name and column name, and always replace those with the proper table and column names that are used for SMF.

As for how much SMF is similar to phpBB: I can't tell. I never used SMF, so I know nothing. But for all s9y importers that are there, the table structure is always very similar, so it would strike me quite oddly if SMF would divert a lot.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Post by 3nd3r »

Thank you!

I'm going to modify the php, and if I get success, I can upload to wherever you tell me to share this new importer, if you agree.
Try not. Do, or do not. There is no try.
robi-bobi
Regular
Posts: 40
Joined: Mon Nov 21, 2005 12:40 pm
Location: Bulgaria
Contact:

Post by robi-bobi »

maybe it will be easer for you to find SMF to phpBB converter and then use s9y converter from phpBB ;)
I made search on phpbb forums and it looks like there are a few SMF -> converters

(as always, make backups before doing anything)
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Post by 3nd3r »

Thanks robi! A great idea!

I'm working on that. I've got some problems on conversion from SMF to phpBB3... Nothing very important, but a little bugsy

Thanks again! I'll tell you if I get it.
Try not. Do, or do not. There is no try.
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Post by 3nd3r »

Ok! Now my SMF is converted to phpBB3 !

So, I've tried to convert to s9y and this message appears:

Code: Select all

Importación fallida: No se puede seleccionar la información del usuario: Unknown column 'user_level' in 'field list'.
What should I do?

Thanks in advance for your time
Try not. Do, or do not. There is no try.
Post Reply