Advertisement:

Author Topic: Import posts from a file to an SMF thread?  (Read 8534 times)

Offline The Lurker

  • Semi-Newbie
  • *
  • Posts: 27
Import posts from a file to an SMF thread?
« 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!


Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,098
  • Gender: Male
    • Kindred-999 on GitHub
Re: Import posts from a file to an SMF thread?
« Reply #1 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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline shawnb61

  • Support Specialist
  • Full Member
  • *
  • Posts: 507
    • sbulen on GitHub
Re: Import posts from a file to an SMF thread?
« Reply #2 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. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline The Lurker

  • Semi-Newbie
  • *
  • Posts: 27
Re: Import posts from a file to an SMF thread?
« Reply #3 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.

Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,344
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Import posts from a file to an SMF thread?
« Reply #4 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
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline The Lurker

  • Semi-Newbie
  • *
  • Posts: 27
Re: Import posts from a file to an SMF thread?
« Reply #5 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!


Offline ABCDiamond

  • Semi-Newbie
  • *
  • Posts: 49
Re: Import posts from a file to an SMF thread?
« Reply #6 on: July 21, 2017, 09:14:55 PM »
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.