mysql -BN -e "select username, title, from_unixtime(dateline), pagetext from vb_post where threadid = '5728' order by dateline;" > thread-5728.tsv (plus some not yet programed text massaging -- quoting quote tag names, unquoting url strings, replacing \r\n and \n with real newlines) ========== echo "select postid, threadid, username, userid, title, from_unixtime(dateline) from vb_post where parentid = '0'" | mysql -h localhost -p godiscussions > initial_threads.txt mysql> select count(*) from vb_post where parentid = '0'; +----------+ | count(*) | +----------+ | 10545 | +----------+ 1 row in set (0.50 sec) mysql> select lastthreadid from vb_forum where title = 'Requests'; +--------------+ | lastthreadid | +--------------+ | 9438 | +--------------+ 1 row in set (0.00 sec) mysql> select postid, parentid, username, userid, title, from_unixtime(dateline) from vb_post where threadid = '9438' order by postid; +--------+----------+-----------+--------+----------------------------------+-------------------------+ | postid | parentid | username | userid | title | from_unixtime(dateline) | +--------+----------+-----------+--------+----------------------------------+-------------------------+ | 115690 | 0 | aguido | 5757 | Australian Go Association forum? | 2009-06-11 02:26:55 | | 118726 | 115690 | koks9dan | 5189 | | 2009-07-09 12:19:04 | | 126599 | 118726 | Darkumbra | 7436 | | 2009-09-11 12:06:19 | | 126721 | 126599 | koks9dan | 5189 | | 2009-09-12 01:51:08 | | 126773 | 126721 | Darkumbra | 7436 | | 2009-09-12 11:11:58 | | 130807 | 126599 | aguido | 5757 | | 2009-10-06 02:18:37 | | 131792 | 130807 | Darkumbra | 7436 | | 2009-10-12 11:22:56 | +--------+----------+-----------+--------+----------------------------------+-------------------------+ 7 rows in set (0.08 sec) pagetext ============ mysql> select sum(threadcount) from vb_forum; +------------------+ | sum(threadcount) | +------------------+ | 10703 | +------------------+ 1 row in set (0.02 sec) mysql> select count(*) from vb_post; +----------+ | count(*) | +----------+ | 143572 | +----------+ 1 row in set (0.00 sec) mysql> select count(distinct threadid) from vb_post; +--------------------------+ | count(distinct threadid) | +--------------------------+ | 10539 | +--------------------------+ 1 row in set (1.19 sec) ========== mysql> show tables; +----------------------------+ | Tables_in_godiscussions | +----------------------------+ | bios | | blogs | | comments | | friends | | notes | | product_images | | products | | products_tags | | reviews | | tags | | users | | vb_access | | vb_adminhelp | | vb_administrator | | vb_adminlog | | vb_adminmessage | | vb_adminutil | | vb_album | | vb_albumpicture | | vb_albumupdate | | vb_announcement | | vb_announcementread | | vb_attachment | | vb_attachmentpermission | | vb_attachmenttype | | vb_attachmentviews | | vb_avatar | | vb_bbcode | | vb_bookmarksite | | vb_calendar | | vb_calendarcustomfield | | vb_calendarmoderator | | vb_calendarpermission | | vb_cpsession | | vb_cron | | vb_cronlog | | vb_customavatar | | vb_customprofilepic | | vb_datastore | | vb_deletionlog | | vb_discussion | | vb_discussionread | | vb_editlog | | vb_event | | vb_externalcache | | vb_faq | | vb_forum | | vb_forumpermission | | vb_forumprefixset | | vb_forumread | | vb_groupmessage | | vb_groupmessage_hash | | vb_groupread | | vb_holiday | | vb_humanverify | | vb_hvanswer | | vb_hvquestion | | vb_icon | | vb_imagecategory | | vb_imagecategorypermission | | vb_impexerror | | vb_infraction | | vb_infractionban | | vb_infractiongroup | | vb_infractionlevel | | vb_language | | vb_mailqueue | | vb_moderation | | vb_moderator | | vb_moderatorlog | | vb_notice | | vb_noticecriteria | | vb_noticedismissed | | vb_passwordhistory | | vb_paymentapi | | vb_paymentinfo | | vb_paymenttransaction | | vb_phrase | | vb_phrasetype | | vb_picture | | vb_picturecomment | | vb_picturecomment_hash | | vb_plugin | | vb_pm | | vb_pmreceipt | | vb_pmtext | | vb_pmthrottle | | vb_podcast | | vb_podcastitem | | vb_poll | | vb_pollvote | | vb_post | +----------------------------+ 92 rows in set (0.00 sec) mysql> describe vb_forum; +-------------------+-----------------------+------+-----+----------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------------+-----------------------+------+-----+----------+----------------+ | forumid | smallint(5) unsigned | NO | PRI | NULL | auto_increment | | styleid | smallint(5) unsigned | NO | | 0 | | | title | varchar(100) | NO | | | | | title_clean | varchar(100) | NO | | | | | description | text | YES | | NULL | | | description_clean | text | YES | | NULL | | | options | int(10) unsigned | NO | | 0 | | | displayorder | smallint(6) | NO | | 0 | | | replycount | int(10) unsigned | NO | | 0 | | | lastpost | int(11) | NO | | 0 | | | lastposter | varchar(100) | NO | | | | | lastthread | varchar(250) | NO | | | | | lastthreadid | int(10) unsigned | NO | | 0 | | | lasticonid | smallint(6) | NO | | 0 | | | threadcount | mediumint(8) unsigned | NO | | 0 | | | daysprune | smallint(6) | NO | | 0 | | | newpostemail | text | YES | | NULL | | | newthreademail | text | YES | | NULL | | | parentid | smallint(6) | NO | | 0 | | | parentlist | varchar(250) | NO | | | | | password | varchar(50) | NO | | | | | link | varchar(200) | NO | | | | | childlist | text | YES | | NULL | | | importforumid | bigint(20) | NO | | 0 | | | importcategoryid | bigint(20) | NO | | 0 | | | lastpostid | int(10) unsigned | NO | | 0 | | | showprivate | tinyint(3) unsigned | NO | | 0 | | | defaultsortfield | varchar(50) | NO | | lastpost | | | defaultsortorder | enum('asc','desc') | NO | | desc | | | lastprefixid | varchar(25) | NO | | | | | imageprefix | varchar(100) | NO | | | | +-------------------+-----------------------+------+-----+----------+----------------+ 31 rows in set (0.08 sec) mysql> describe vb_post; +----------------+----------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------+----------------------+------+-----+---------+----------------+ | postid | int(10) unsigned | NO | PRI | NULL | auto_increment | | threadid | int(10) unsigned | NO | MUL | 0 | | | parentid | int(10) unsigned | NO | | 0 | | | username | varchar(100) | NO | | | | | userid | int(10) unsigned | NO | MUL | 0 | | | title | varchar(250) | NO | | | | | dateline | int(10) unsigned | NO | | 0 | | | pagetext | mediumtext | YES | | NULL | | | allowsmilie | smallint(6) | NO | | 0 | | | showsignature | smallint(6) | NO | | 0 | | | ipaddress | varchar(15) | NO | | | | | iconid | smallint(5) unsigned | NO | | 0 | | | visible | smallint(6) | NO | | 0 | | | attach | smallint(5) unsigned | NO | | 0 | | | importthreadid | bigint(20) | NO | | 0 | | | importpostid | bigint(20) | NO | MUL | 0 | | | infraction | smallint(5) unsigned | NO | | 0 | | | reportthreadid | int(10) unsigned | NO | | 0 | | +----------------+----------------------+------+-----+---------+----------------+ 18 rows in set (0.00 sec)