ElkArte Community

General => OpenImporter => Topic started by: Ruth on October 19, 2014, 10:39:54 am

Title: SMF 1.1.20 to ElkArte
Post by: Ruth on October 19, 2014, 10:39:54 am
Hello!

Today morle800 tried preparing my forum to migrate it to ElkArte.
The SMF version of my forum is 1.1.15 .
He made a copy of all files and uploaded them to his own host.
Updating from  1.1.15 to SMF 1.1.20 was successful there.
Upgrade to SMF 2.0.9 seems first to work, too - but all posts were empty.

The copy of my forum is now SMF 1.1.20. Posts and images are shown.

Is there an importer to ElkArte for SMF 1.1.20?
Title: Re: SMF 1.1.20 to ElkArte
Post by: emanuele on October 19, 2014, 12:59:23 pm
Could it be the charset of your SMF is ISO-something?
In theory OpenImporter should convert the messages to UTF8, but with all the stuff going on during a charset conversion I wouldn't be surprised by some kind of issue in some configuration... :-\

If it is ISO-something, you may try converting it to UTF8 before the import.

If that doesn't work or the charset is already UTF8, and you are brave enough, I may want to try with the "upgrade package", it's not distributed, so it's only available through the repository, but if you need it I can pack it for you.
Title: Re: SMF 1.1.20 to ElkArte
Post by: Ruth on October 19, 2014, 01:13:21 pm
Thank you very much, emanuele...I think, the forum is already in UTF8.

I can't explain exactly what was going wrong by trying the upgrade to 2.0.9. because I was just watching, ;)  morle800 did all the work. O:-)  I also don't know the english words for the errors wich appeared.

So I better wait for morle800, certainly he will be able to give a better reply then me.
Title: Re: SMF 1.1.20 to ElkArte
Post by: emanuele on October 19, 2014, 01:23:20 pm
Oh right, you said that in 2.0.9 it went bad.
Sorry, I misread the message... :-[
Title: Re: SMF 1.1.20 to ElkArte
Post by: Ruth on October 19, 2014, 01:50:41 pm
I was wrong, emanuele...  :-[

But the forum is now in UTF8, morle800 changed it.

He is now on the phone with me. I shall ask, if it is possible to use the open importer for SMF 1.1.20?
Title: Re: SMF 1.1.20 to ElkArte
Post by: emanuele on October 19, 2014, 02:48:33 pm
No, there no direct importer from SMF 1.1.x to ElkArte with OpenImporter.
Title: Re: SMF 1.1.20 to ElkArte
Post by: Nao on October 19, 2014, 04:15:08 pm
Really? I think the Wedge importer supports SMF 1.x, and since OpenImporter is based on the Wedge importer, it would make sense to support it as well...?

PS: Shawn sucks... Can't believe he actually went ahead and deleted his forum... So much for the time we spent contributing to it! What a waste...
Title: Re: SMF 1.1.20 to ElkArte
Post by: Spuds on October 20, 2014, 01:12:42 pm
I did not know he did that.  Looks like it was a quick decision to close the site, or at least once he decided it was quick.

I've never tried to upgrade with OI from smf 1.x, I think the intention was to use SMF's upgrade scripts to get it to a 2.x level and then let OI do the import to Xyz ... not a one step process but should be a safe route.
Title: Re: SMF 1.1.20 to ElkArte
Post by: emanuele on October 20, 2014, 03:00:03 pm
Nope, SMF 1.1 is not in the list of available importers, though it shouldn't be terribly difficult to add, SMF 1.1 and 2.0 database structure was not so different AFAIR.
Yep, just checked and the main difference are the case of the fields.

ohh... and that reminds me of a thing... better to use the OI topic. :)
Title: Re: SMF 1.1.20 to ElkArte
Post by: Ruth on October 21, 2014, 04:53:10 am
Upgrade from SMF 1.1.20 to SMF 2.0.9 was successful now. :)

The reason why it didn't worked first,  were too much Smileys in the database or too long file-names for some of them.

morle800 tried now to import the SMF 2.0.9 to ElkArte with the open importer.

This error was shown:
Title: Re: SMF 1.1.20 to ElkArte
Post by: Jorin on October 21, 2014, 05:00:55 am
Maybe this is because of changing the attachments to shorter file names or has Morle deleted some of them? The script is searching for some attachments named in the database but can't find the files on the server.
Title: Re: SMF 1.1.20 to ElkArte
Post by: emanuele on October 21, 2014, 05:16:44 am
Or I broke the importer or you have an old copy.
Try downloading it again, I tried to fix a similar bug last week (or so) and maybe you still have the old one, or maybe my fix didn't fix the problem or created a new bug. O:-)
Title: Re: SMF 1.1.20 to ElkArte
Post by: Ruth on October 21, 2014, 05:33:31 am
He did not change the file-names of our smileys and he did not try to import our Smileys, Jorin.  He was taking just the very few smileys, wich are in default.

But maybe it has to do with our topic icons. Some of them are gifs. Shall we delete them?

 I think, that Smileys are no attachments? Attachments means pictures wich are added to the posts? Is this wrong?

I will tell morle800 this about the importer, emanuele.


Edit: In the copy of my forum on morles host are not all attachments displayed...Error 404. So maybe this is the reason.
Title: Re: SMF 1.1.20 to ElkArte
Post by: Jorin on October 21, 2014, 06:36:59 am
I talked about attachments, not smileys. ;)
Title: Re: SMF 1.1.20 to ElkArte
Post by: morle800 on October 21, 2014, 07:11:04 am
I have the openimporter yesterday downloaded  ;)

It lacks 20,000 attachments

I invite everyone back to the server , and try again later
Title: Re: SMF 1.1.20 to ElkArte
Post by: Jorin on October 21, 2014, 07:16:39 am
Sorry, we are discussing this in the german support forum too. O:-)

It seems there are a few thousand files missing on the server. Morle will look for it later.
Title: Re: SMF 1.1.20 to ElkArte
Post by: emanuele on October 21, 2014, 09:20:01 am
Yes, I'm obviously an idiot...
Code: [Select]
$attachmentUploadDir = !empty($attachment_UploadDir[1]) && is_array($attachment_UploadDir[1]) ? $attachment_UploadDir[1] : $attachmentdir;
should be:
Code: [Select]
$attachmentUploadDir = !empty($attachment_UploadDir[1]) && is_array($attachment_UploadDir) ? $attachment_UploadDir[1] : $attachmentdir;
in import.php.
That should work for now, though I'm not entirely sure it would work for an SMF 2.0 with multiple attachments directories... :-\

Sorry... :-[
Title: Re: SMF 1.1.20 to ElkArte
Post by: Ruth on October 21, 2014, 02:22:58 pm
This time the importer worked without an error. The posts are there, but all the attachments are not displayed.
Emanuele, would you  please have a look into the adminpanel?  O:-)

Maybe something can be done here?
Title: Re: SMF 1.1.20 to ElkArte
Post by: morle800 on October 21, 2014, 05:44:05 pm
I have changed the import.php . Now I get this error
Title: Re: SMF 1.1.20 to ElkArte
Post by: emanuele on October 21, 2014, 06:43:16 pm
Okay, I found another bug in the importer.
In smf2_importer.xml, find:
Code: [Select]
			$smf_attachments_dir =  rtrim($smf_attachments_dir, '/');
and replace it with:
Code: [Select]
			$attachment_UploadDir = @unserialize($smf_attachments_dir);
if (!empty($attachment_UploadDir[1]) and is_array($attachment_UploadDir))
$smf_attachments_dir = $attachment_UploadDir[1];
Title: Re: SMF 1.1.20 to ElkArte
Post by: emanuele on October 26, 2014, 10:57:25 am
Sorry for the long silence.
I have been lost messing with the OpenImporter code (you may have read about it here (http://www.elkarte.net/community/index.php?topic=2118.0).
I'm still a bit far from where I'd like to go, but I'll try to fix this attachments problem this week, unless maybe
@TE (that is more familiar with the OI code) has an idea.

Also, the problem as I see it from the error message is that the attachment upload dir is not unserialized, in theory the code I posted works, and it worked for me on my testing install, so I'm a bit lost at what the issue now could be... :(

If you have a testing environment I can get access to with the two databases and OI I could try to see if I missed something that is not evident on my test install.
Title: Re: SMF 1.1.20 to ElkArte
Post by: Jorin on October 26, 2014, 11:09:01 am
I will test migrate my SMF 2.0.7 next week (the last, final test), if this helps?
Title: Re: SMF 1.1.20 to ElkArte
Post by: emanuele on October 26, 2014, 11:22:28 am
Do you use attachments?
Title: Re: SMF 1.1.20 to ElkArte
Post by: Jorin on October 26, 2014, 11:35:47 am
Yep. Attachments, embedded Youtube videos, image links with and without IMG BBC, all kinds of this stuff.
Title: Re: SMF 1.1.20 to ElkArte
Post by: emanuele on October 26, 2014, 12:34:01 pm
You may have problems with attachments then... :(
Title: Re: SMF 1.1.20 to ElkArte
Post by: Jorin on October 26, 2014, 01:29:52 pm
Hm. I thought I didn't had before on my first try. But I didn't check all the attachments. It seemed they were okay.
Title: Re: SMF 1.1.20 to ElkArte
Post by: emanuele on October 26, 2014, 04:15:41 pm
Then that is interesting...
May I ask you some more questions?

Do you have one directory?
Did you upgrade from SMF 1.x?
Could you check in the database the value of attachmentUploadDir (settings table) and tell me if it is a simple path, or it looks like
Code: [Select]
s:31:"/this/is/a/demo/serialized/path";
Thanks! :D
Title: Re: SMF 1.1.20 to ElkArte
Post by: TE on October 27, 2014, 03:00:37 am
Attachment related errors may depend on multiple attachment directories set in SMF, not sure but I think I didn't implement that until now.. the other related issue is probably the file encryption. SMF 1.1 didn't enforce filename encryption, thus there could be a mixture of encrypted and not encrpyted files..
Sorry, I'm still busy with RL stuff  :(
Title: Re: SMF 1.1.20 to ElkArte
Post by: Jorin on October 27, 2014, 03:15:58 am

Sure!


You mean for attachments? Yes, it's only one directory.


No, this forum started with 2.0.0.

Quote from: emanuele – Could you check in the database the value of attachmentUploadDir (settings table) and tell me if it is a simple path, or it looks like
Code: [Select]
s:31:"/this/is/a/demo/serialized/path";

It's a simple path:

Code: [Select]
/www/htdocs/xyz/prius/attachments
Title: Re: SMF 1.1.20 to ElkArte
Post by: Jorin on October 27, 2014, 03:16:54 am
Quote from: TE – Sorry, I'm still busy with RL stuff  :(

As long as you're okay and fine!  :)
Title: Re: SMF 1.1.20 to ElkArte
Post by: emanuele on October 27, 2014, 04:59:23 am
No problem TE! :D

Okay, so it seems my "fix" to unserialize the array didn't work as expected.
I have to try it more.
But at least the good news is that the issue is what I thought it was and what I thought I fixed, so there is just to fix it properly! :D
Title: Re: SMF 1.1.20 to ElkArte
Post by: Jorin on October 27, 2014, 05:06:37 am
Oh, maybe it's important that I never fixed the importer the way you described here in this thread. I can tell what version I used when I'm at home later.