• Hi, I have to migrate my database for a 4 year old wordpress blog.

    I have a backup script that runs daily. However, I just noticed today that the ^#^$#^$ db sql file is 93 MB big. And I really don’t keep a lot of comments.

    That is humongous, and most of it is from a web statistic analyzer, statraq which I disabled a year ago. About midway through the file until the very end, everything is statraq transactions like this. Is it safe to just delete this section to shrink the db size?

    Midway through the .sql, file, it goes:
    — Table structure for table b2stattraq

    DROP TABLE IF EXISTS b2stattraq;
    CREATE TABLE b2stattraq (
    line_id int(11) NOT NULL auto_increment,
    session_id varchar(128) NOT NULL default ‘0’,
    access_time datetime default NULL,
    ip_address varchar(255) NOT NULL default ”,
    url varchar(255) NOT NULL default ”,
    article_id varchar(128) NOT NULL default ‘0’,
    user_agent varchar(255) NOT NULL default ”,
    browser varchar(64) default NULL,
    user_agent_type int(11) NOT NULL default ‘0’,
    referrer varchar(255) default NULL,
    search_phrase varchar(255) default NULL,
    PRIMARY KEY (line_id)
    ) TYPE=MyISAM;


    — Dumping data for table b2stattraq

    INSERT INTO b2stattraq (line_id, session_id, access_time, ip_address, url, article_id, user_agent, browser, user_agent_type, referrer, search_phrase) VALUES (1,’f6541b209f68f3283a649eecdb121c19′,’2004-11-28 13:33:08′,’192.168.0.3′,’/weblogs/idiotprogrammer/index.php?’,’0′,’Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0′,’Mozilla Firefox’,0,NULL,NULL);
    transactions recorded.

    etc for 45 more megabytes!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Yes.

    You should be able to delete all references to b2stattraq and import the remainder into a new database.

    If you think you may need the empty table, you could leave the ‘CREATE TABLE b2stattraq…’ section and just remove all the data inserts.

    You look at what are the core tables in your db
    1.5.2 has nine

    You look at other tables that are essential. Spam ones are not, stats ones are not. And you delete the lot.

    If you want, backup the whole thing first.
    Then DROP tables, or EMPTY tables.
    http://www.tamba2.org.uk/wordpress/empty-drop/

    And 93 meg ? Nah… I’ve dealt with a 20meg+ one – so you will be fine 🙂

    u can also try to optimise the database to remove the extra clutter. it has saved me quite many megs while taking backups!

    Thread Starter idiotprogrammer

    (@idiotprogrammer)

    Wow, what great information!

    Is dropping the table with a SQL table any safer/more dangerous than deleting the section in the .sql file.

    Robert Nagle

    Dropping it is easier than opening a 93meg file 🙂

    right. ur text editor would perhaps freak out doing that.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘holy crap! 93 MB db: how to reduce?’ is closed to new replies.