Skip to main content
[SMF 2.1] Importer Started by TE · · Read 49398 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic

[SMF 2.1] Importer

This importer is intendet to import a SMF 2.1 (Beta) installation to ElkArte:

Notes:
-  Currently the passwords are not converted, so you have to use the "Forgot your password?"  link ..
- Likes and Mentions are not converted, maybe I'll add them later..

importing settings... ✔
Importing members... ✔
Importing attachments... ✔
Importing avatars... ✔
Importing categories... ✔
Importing boards... ✔
Importing topics... ✔
Importing messages... ✔
Importing polls... ✔
Importing poll choices... ✔
Importing poll votes... ✔
Importing personal messages... ✔
Importing pm recipients... ✔
Importing pm rules... ✔
Importing board moderators... ✔
Importing mark read data (boards)... ✔
Importing mark read data (topics)... ✔
Importing mark read data... ✔
Importing notifications... ✔
Importing membergroups... ✔
Importing group moderators... ✔
Importing permission profiles... ✔
Importing permissions... ✔
Importing board permissions... ✔
Importing smileys... ✔
Copying smileys... ✔
Importing statistics (activity log)... ✔
Importing logged actions... ✔
Importing reported posts... ✔
Importing reported comments... ✔
Importing spider hits... ✔
Importing spider stats... ✔
Importing subscriptions... ✔
Recalculating statistics... ✔
Thorsten "TE" Eurich
------------------------

Re: [SMF 2.1] Importer

Reply #1

Why not just add this as a Source for the Open Importer?

Re: [SMF 2.1] Importer

Reply #2

Quote from: Eliana Tamerin – Why not just add this as a Source for the Open Importer?
It is open importer (just an older version because the current one is badly broken..) ;)
Thorsten "TE" Eurich
------------------------

Re: [SMF 2.1] Importer

Reply #3

Thanks @TE

Re: [SMF 2.1] Importer

Reply #4

Quote from: TE – It is open importer (just an older version because the current one is badly broken..) ;)
The only problem I have with the master branch is with a regex, applying this patch works fine for me:
Code: [Select]
diff --git a/importer/OpenImporter/XmlProcessor.php b/importer/OpenImporter/XmlProcessor.php
index 9f08465..f9bb8ed 100644
--- a/importer/OpenImporter/XmlProcessor.php
+++ b/importer/OpenImporter/XmlProcessor.php
@@ -346,7 +346,7 @@ class XmlProcessor
        protected function detect($table)
        {
                $table = $this->fix_params($table);
-               $table = preg_replace('/^[icode][\w\d]*[/icode]\./i', '', $this->fix_params($table));
+               $table = preg_replace('/^[icode][\w\d\-_]*[/icode]\./i', '', $this->fix_params($table));
 
                $db_name_str = $this->config->source->getDbName();
Bugs creator.
Features destroyer.
Template killer.

Re: [SMF 2.1] Importer

Reply #5

Quote from: emanuele – The only problem I have with the master branch is with a regex, applying this patch works fine for me:
yep, you're probably right... sorry.. should have been more specific on the issues I found.

Master branch: At least the MyBB importers are  badly broken due to the var / object $config (it is an object in OI and also a global var in the  MyBB config files)
DEV branch Maybe it's beyond my skills due to composer and all that stuff but I wasn't able to get OI working at all..
Thorsten "TE" Eurich
------------------------

Re: [SMF 2.1] Importer

Reply #6

I had some problems as well, but a few were self induced as well  :-[

For the dev revision you need to have composer installed on your system.
Code: [Select]
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
Then pull the development branch from GIT, say to /var/www ... then change to the importer directory.  On my vagrant setup that is /var/www/importer (where /var/www is a shared folder to where I have my Open Importer repo).  Then from that directory simply do
Code: [Select]
composer install
It will download all of the dependencies and place them in a /vendor directory, this includes symfony and doctrine.

In my IDE (PhpStorm) I also set the project resource root to the /importer directory so it picked up everything.  I don't really know much (if anything) about symfony or doctrine, but those are more core side of things vs the importer side.  

I did not realize that the master branch was not the current working version, I should have started looking at that branch (just did) so now the dev branch direction makes a lot more sense to me.  I guess master is more like a 1.1 and dev is 2.0 and the current working code is really a "point" in the master branch (maybe we should do a point release of 1.0 from master?)

Quoteobject $config
I'll refactor that to $oi_config (and anything else I see that should be $oi_* to avoid conflicts.  I think the namespace in 1.1 avoids that though)

Re: [SMF 2.1] Importer

Reply #7

Quote from: TE – yep, you're probably right... sorry.. should have been more specific on the issues I found.
Nothing to be sorry about, come on!
I just wanted to be sure I wasn't miss anything big! :D

Quote from: TE – Master branch: At least the MyBB importers are  badly broken due to the var / object $config (it is an object in OI and also a global var in the  MyBB config files)
And in fact I was. *facepalm*!
That's one of the reasons in the dev branch I started "parsing" the configuration files as strings rather than loading them, so there will not be conflicts like this one in the future. The idea is to read the content of the file and use a regex or some similar solution to get the values of the variables.

Quote from: TE – DEV branch Maybe it's beyond my skills due to composer and all that stuff but I wasn't able to get OI working at all..
As Spuds said it needs composer (that once used is not really difficult, but if nobody tells others how to use it it's a bit of a headache... And I didn't write any documentation about it... sorry. :-[ ), and that's why I'd like to have at some point a "build bot" able to prepare packages ready-to-use for easier testing.
Bugs creator.
Features destroyer.
Template killer.

Re: [SMF 2.1] Importer

Reply #8

It's great news to see this.  Thank you!  A couple of quick questions:  1. how do you use this?  2.  Is there a possibility Elk will go to the bcrypt credentials?

Re: [SMF 2.1] Importer

Reply #9

1) extract the attached archive, upload the files to your webserver and call import.php from a webbrowser. then follow the instructions.
2) Maybe ... Haven't checked their new passwords encryption yet, they are using bcrypt too?
Thorsten "TE" Eurich
------------------------

Re: [SMF 2.1] Importer

Reply #10

If I'm not wrong, Elk is already using CRYPT_BLOWFISH as first choice when available, then CRYPT_EXT_DES and if none of these is available several rounds of md5.
So, if the server has what is required it should already use "bcrypt" (of course if I got right how phpass works).
Bugs creator.
Features destroyer.
Template killer.

Re: [SMF 2.1] Importer

Reply #11

Then I have made an erroneous assumption concerning the passwords not porting.  Thanks for the info! 

Re: [SMF 2.1] Importer

Reply #12

The password not being portable may be for many reasons.
Elk uses the http://www.openwall.com/phpass/ library for password hashing (just because we realized that if nearly all the most famous software use it (WordPress, phpBB, Drupal, Joomla) there may be a reason, that it could be, for how much we know about security, a company focused on security is likely to know more than we do), so it adds a $P$ prefix to the string. Then Elk pass to phpass and sha-256 hash of user . password.
These are two differences, there may be more...
Bugs creator.
Features destroyer.
Template killer.

Re: [SMF 2.1] Importer

Reply #13

im getting error on members import on this, no mods installed says "Unknown column 'hide_email' in 'field list'" caused the error :/

Fixed it by removing that field from the importer file and also the latestMember caused error so removed that seems everything converted fine afterwards.
Last Edit: March 14, 2016, 08:25:09 pm by TrayBake
Bryan Deakin
Former Project Manager/Customiser/Marketing @ SMF

Re: [SMF 2.1] Importer

Reply #14

Which version of 2.1 were you importing from?  I know there are a couple of beta versions out there.