News:

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

Main Menu

Need help with importing raw different formatted data to smf forum

Started by rii, January 23, 2009, 04:08:48 AM

Previous topic - Next topic

rii

I have just installed the smf 2.4 beta 4 public version and it is working fine so far.

I have a sql data file from my old website. It is total of about 5,000 articles in MySQL with this form:

INSERT INTO `articles` (`id`, `cat_id`, `header`, `content`, `pix`, `pix_align`, `writer`, `hit`, `date`, `approved`) VALUES
(55, 10, 'articles text goes here', 'none', 'right', 'JK', 6685, '2003-05-23 17:50:37', 'Yes'),


-------------

The current smf MySQL data is in this form:

INSERT INTO `smf_messages` (`id_msg`, `id_topic`, `id_board`, `poster_time`, `id_member`, `id_msg_modified`, `subject`, `poster_name`, `poster_email`, `poster_ip`, `smileys_enabled`, `modified_time`, `modified_name`, `body`, `icon`, `approved`) VALUES
(1, 1, 1, 1231730086, 0, 1, 'subject/title goes here', 'author name goes here', 'author email goes here', '127.0.0.1', 1, 0, '', 'body of the message goes here', 'xx', 1),


--------------

I need help with following concerns:
- How do I change the date and time so it will be in format like 1231730086 instead of like 2003-05-23 17:50:37? If this is not possible, what will be the alternatives?
- I believe the data from articles table can insert into the smf_messages table, but I am not sure how to take care of the associate tables like smf_topics so each post will have own stats like normal forum topic does.
- What will be the best way to accomplish this? Manually entering each article to the forum will be life-long process.


Please advise me.

Thank you.

rii

Can someone give me suggestion on how to handle this issue, please?

Thank you.


greyknight17

I don't know of an easy way to do this. You can try separating each of those values into their own fields in a Excel worksheet so all the date and time for those articles are in one column. Then go to this site and copy 500 entries into it to do a batch conversion. Copy the unix time stamp back to the Excel file. Repeat until done. Then do a concatenation/join of all those cells to make them whole again.

rii

Hi, I am just updating this post. The actual hit count for the topic messages are in the smf_topics table. This issue is resolved. Thanks to greyknight17 and Jared !  :)

Advertisement: