News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Converter ipb 1.3 to 2.0

Started by Mqaximo, July 31, 2008, 05:12:40 AM

Previous topic - Next topic

Mqaximo

Hi guys, i tryed to make a converter for IPB 1.3 to SMF 2.0 beta 3.1 Public, it seems function well but if someone would like to try it or just need to use it, you can find the converter attached in this post.

I hope you'll appreciate it, let me know if you note some errors.

Bye  ;)

NB: There are 2 archives, the first works for versions before MySQL 5;
The second works for versions equal/greater than MySQL 5 due to an unsupported function described here:

http://docs.simplemachines.org/index.php?topic=1079.0

---
p.s.:I tried also this converter to convert from IPB1.3 to SMF 2.0 RC1 and it works fine. ;)

p.p.s.:this is not an official converter, i made it from the official converter just for myself, but maybe could be useful also for the actual developers or users. ;)

Bye

ThorstenE

nice to read that someone other is helping here in the converter board :)

The script itself has some things that could run into problems..

SMF 2 uses only lower case table- und field-names, so you should not use "ID_MEMBER" or "ID_BOARD".. (use id_member, id_board instead) upper case  might work on Windows based MySQL-Servers but should run into problems on Unix/Linux/Macintosh systems..

conversion scripts are very sensitive, if you are using wrong SQL-statements (like TRUNCATE {$from_prefix}users for example) all source-forum data is destroyed. so i allways recommend to contact one of the team members (my Mentor SleePy is a good choice) before releasing a script yourself.. As an apperentice i also send all my work to my mentor and do not release it myself. I hope you can understand my opinion.

btw, help is always welcome  :)

Mqaximo

Thank you so mutch ThorsenE for your suggestions, i appreciate them a lot ;)

I know that maybe i should contact a mentor.. but i'm new of this forum and i don't know noone... So i didn't know the right procedure to release something :-[

I'll correct the script and i'll test it on linux systems and i'll update it (maybe broking boxes to anyone ;D)

Thanks again ;)

SleePy

Was this actually tested?

I did write a simple php myself that quickly changes columns to lower case. I still need to work out a fancy regex to find and replace the table alterations in scripts to use the new functions I added in the convert.php for 2.0

I haven't actually tested any of the converters besides a few (like phpbb3 and aef :P )
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Mqaximo

#4
Yes, under Windows using EasyPHP2 and under LAMP server with following configuration:
OS: Kubuntu 8.04.1 desktop

WebServer: Apache/2.2.8 (Ubuntu)

PHP Version: 5.2.4-2ubuntu5.3

MySQL client: 5.0.51a

phpMyAdmin - 2.11.3deb1ubuntu1


I tryed to run the converter without controlling the uppercase of the names of tables and it seems to go well under windows and under Linux, so (for problems of time :P) for the moment i'll not fix it, but if someone would like to "give an hand" that's a great point to start  ;)

Bye! :D

Mqaximo


Mqaximo

#6
Archi let me note that there are some problems in converting posts.

The problems are referred to a bad use of regular expression in invision_to_smf.sql

1)TAG SIZE
The size of fonts are inverted! (small fonts are converted in big while big fonts in small)
He suggested me to substitute 3 times the following line of text
'~<span style=\'font-size:([^;]+?).+?\'>(.+?)</span>~is',
with:
'~<span style=\'font-size:([^;]+).+?\'>(.+?)</span>~is',

2)TAG QUOTE
The quote of messages does not display nor the author of quote nor the date of message.

3)PREVIEW OF IMAGES ATTACHED
The preview is not available, the image appear on the post as a downloadable file but the preview isn't available.


Now, Archi Fixed the first problem (relative to the size of text), i'm working on the others, as we have some news we will keep you informed  ;)

Special Thanks to Archi for discovering and fixing the actual bugs  ;)

Mqaximo

About the "QUOTE" problem is possible to correct this issue by following the solution of Archi (didn't inserted the changes in the files because the solution isn't so scalable also for the other languages):

Quote from: archi on September 26, 2008, 03:37:34 PM
I solved the QUOTE problem in this way:

1. Open invision_to_smf.sql
2. find 3 times the code:

'~<!--QuoteBegin.*?-->.+?<!--QuoteEBegin-->~is'

3. each time substitute with the code:

'~<!--QuoteBegin-->.+?<!--QuoteEBegin-->~is',
'~<!--QuoteBegin-([^\+]+?)\+-->.+?<!--QuoteEBegin-->~is',
'~<!--QuoteBegin-([^\+]+?)\+([0-9]{2})-Jan-([^-]+?)-->.+?<!--QuoteEBegin-->~is',
'~<!--QuoteBegin-([^\+]+?)\+([0-9]{2})-Feb-([^-]+?)-->.+?<!--QuoteEBegin-->~is',
'~<!--QuoteBegin-([^\+]+?)\+([0-9]{2})-Mar-([^-]+?)-->.+?<!--QuoteEBegin-->~is',
'~<!--QuoteBegin-([^\+]+?)\+([0-9]{2})-Apr-([^-]+?)-->.+?<!--QuoteEBegin-->~is',
'~<!--QuoteBegin-([^\+]+?)\+([0-9]{2})-Maj-([^-]+?)-->.+?<!--QuoteEBegin-->~is',
'~<!--QuoteBegin-([^\+]+?)\+([0-9]{2})-Jun-([^-]+?)-->.+?<!--QuoteEBegin-->~is',
'~<!--QuoteBegin-([^\+]+?)\+([0-9]{2})-Jul-([^-]+?)-->.+?<!--QuoteEBegin-->~is',
'~<!--QuoteBegin-([^\+]+?)\+([0-9]{2})-Aug-([^-]+?)-->.+?<!--QuoteEBegin-->~is',
'~<!--QuoteBegin-([^\+]+?)\+([0-9]{2})-Sep-([^-]+?)-->.+?<!--QuoteEBegin-->~is',
'~<!--QuoteBegin-([^\+]+?)\+([0-9]{2})-Oct-([^-]+?)-->.+?<!--QuoteEBegin-->~is',
'~<!--QuoteBegin-([^\+]+?)\+([0-9]{2})-Nov-([^-]+?)-->.+?<!--QuoteEBegin-->~is',
'~<!--QuoteBegin-([^\+]+?)\+([0-9]{2})-Dec-([^-]+?)-->.+?<!--QuoteEBegin-->~is',


4. find 3 times the code:

'[quote]',

5, substitute each time with the code:

'[quote]',
'[quote=$1]',
'[quote=$1 @ $2-Gen-$3]',
'[quote=$1 @ $2-Feb-$3]',
'[quote=$1 @ $2-Mar-$3]',
'[quote=$1 @ $2-Apr-$3]',
'[quote=$1 @ $2-Mag-$3]',
'[quote=$1 @ $2-Giu-$3]',
'[quote=$1 @ $2-Lug-$3]',
'[quote=$1 @ $2-Ago-$3]',
'[quote=$1 @ $2-Set-$3]',
'[quote=$1 @ $2-Ott-$3]',
'[quote=$1 @ $2-Nov-$3]',
'[quote=$1 @ $2-Dic-$3]',


I'm italian, so I used italian abbreviations for months

However.. I don't like much this solution...

Advertisement: