I have a self-hosted WordPress blog post that got popular and has over 100 comments. I decided to purchase a domain name and use the content from the post to build a single manually coded php page. This is something I do often, but always branch off using a separate WordPress install. Exporting / Importing the comments from the old post into the new one is simple. However, in this case, I decided to just manually code a simple index.php page.
For the comments, I decided to use GentleSource Comments. Comment data is stored in a MySQL database and it’s very lightweight compared to using WordPress. My goal was to then simply export the existing WordPress post comment data into the GentleSource Comments database. That process was easy. Basically, I snagged a copy of the wp_comments table and simply changed the field names to match the appropriate field names of what’s required in the GentleSource Comments database and removed unnecessary fields that were not native to the GentleSource Comments database structure.
Here are some screen shots that offer some visuals on what I am doing.
comment_date field imported from the WordPress wp_comments table
comment_timestamp field native to GentleSource Comments c5t_comment table
Screen shot showing the results of me manually adding the timestamp into the comment_timestamp fields
Online Unix Timestamp Conversion Tool
This is the page where I do the online unix timestamp conversions.
Screen shot showing the manual process of adding the unix timestamp in phpMyAdmin
The project is a success; however, I have one task left to do — and that is to take all of the DATETIME entries from the comment_date field and convert that data to unix timestamp and add it into a new field labeled comment_timestamp. I can easily do this manually line by line in phpMyAdmin, but I would rather do it quickly in mysql> thru a secure shell. The problem is I just can’t seem to figure out the command. Would someone mind helping me out?
Tags: comment_date, Convert MySQL DATETIME, DATETIME, GentleSource, GentleSource Comments, How To, Linux How To, MySQL, MySQL Comment Scripts, MySQL DATETIME to UNIX TIMESTAMP Conversion, MySQL How To, MySQL TIMESTAMP Conversion, PHP Comment Scripts, phpMyAdmin, phpMyAdmin How To, Stack Overflow, TIMESTAMP, UNIX TIMESTAMP, WordPress, WordPress Database, WordPress How To, WordPress Post Comment Export, wp_comments, wp_comments export