Simple Machines Community Forum

SMF Support => Converting to SMF => Topic started by: The Lurker on July 18, 2017, 09:15:19 PM

Title: Import posts from a file to an SMF thread?
Post by: The Lurker on July 18, 2017, 09:15:19 PM
Is it possible to "import" posts from a file (in whatever format) to an existing thread?
- No attachments, just text (and BBCode)
- Existing users (more than one)

Basically, I'd like to migrate a thread from a defunct forum (was saved in a text file).  There are too many posts to do it manually while preserving the order and original authors.

Thank you!

Title: Re: Import posts from a file to an SMF thread?
Post by: Kindred on July 18, 2017, 09:39:27 PM
Anything is possible, f you know how to code it.

I do not believe such a converter currently exists, however
Title: Re: Import posts from a file to an SMF thread?
Post by: shawnb61 on July 19, 2017, 01:57:38 AM
If such a utility does not exist, I'd suggest ways to dump the whole thing in there, like as a PDF.

Or, as one giant post...  Such approaches might be easier. 
Title: Re: Import posts from a file to an SMF thread?
Post by: The Lurker on July 19, 2017, 08:01:53 AM
Dumping as a single post (or several, due to a 64K size limit) is possible, but ugly.

I'll probably have to do that if no better option is available.

Thanks.
Title: Re: Import posts from a file to an SMF thread?
Post by: vbgamer45 on July 19, 2017, 09:23:29 AM
I wrote one many years ago attached. I think imported tab based files or had a csv option too
Title: Re: Import posts from a file to an SMF thread?
Post by: The Lurker on July 19, 2017, 10:28:07 AM
Thank you vbgamer45!

Unfortunately, I am not familiar with PHP.

Can you please elaborate on the script?
In particular, what is the format of the file?
Does it preserve whitespace (number of empty lines), etc.?

( I may have more questions, we can take it to PM if this is not the place to discuss )

Thank you!

Title: Re: Import posts from a file to an SMF thread?
Post by: ABCDiamond on July 21, 2017, 09:14:55 PM
Quote from: vbgamer45 on July 19, 2017, 09:23:29 AM
I wrote one many years ago attached. I think imported tab based files or had a csv option too
I am interested in this aswell.

I have a CSV file of posts from a Wordpress installation, and want to import them into a new SMF forum.

Not sure what the CSV file format needs to be like, (ie: what the headers would be) and what that 'importscript.php' file process is. 
I keep looking at this part of the script [$newtopicid =   createPost($msgOptions, $topicOptions, $posterOptions);] and trying to work out the CSV header names etc., would be for that.

Also, would USERS need to be created first, etc.