Skip to:
Content
Pages
Categories
Search
Top
Bottom

Extreme Database Help– I'm an Idiot

  • (As an afterthought, this ought to be in troubleshooting, but I can’t change it… sorry!)

    Hello. Let me introduce myself. I am an idiot.

    I installed bbPress to my server. I wanted to have user integration with my WordPress installation. Great. I ran the installation, but I knew I’d have to do a lot of things manually because of my server set up. I entered the appropriate information for the config file, and it prompted me to create the config file with certain information in it because it didn’t have permissions to do so. Exactly what I expected. I ran the rest of the setup as it should go, and when I had it commence with the installation, it said that it had installed but with some minor errors. I looked at the config file, and the keys hadn’t been saved. So I entered in the keys as they should have gone, but then I stupidly changed the blasted database prefix to the same prefix as my WordPress installation thinking for some stupid reason that I was changing the setting for WordPress integration! IDIOT! It installs again with some “minor errors,” but this time going to the address of the forum actually brought up the forum instead of the installation prompt. I mozy on over to my WordPress installation (http://ipfcubed.com– which I’ve currently set to be inaccessable to the public– you’ll see why). Now every single draft and scheduled post (as well as unapproved submissions from contributors in the community) is now visible on the main page. When I make a new post, it says the year is 1999 (EDIT: Sorry– the date is still correct, but the post’s address says that it’s 1999: http://ipfcubed.com/1999/11//. The published posts count is also off– it says I have zero published posts in the dashboard. I can see that I’ve majorly messed up the posts table. Can someone PLEASE help me fix it? Any and all suggestions are welcome! Below I’ve provided both the error message and the installation log that it gave me:

    THE LOG (errors below this):

    Referrer is OK, beginning installation…<br />
    >>> Setting up custom user table constants</p>
    <p>Step 1 - Creating database tables<br />
    >>> Modifying database: jordan_wp (localhost)<br />
    >>>>>> Table: ipf3_forums<br />
    >>>>>>>>> Creating table<br />
    >>>>>>>>>>>> Done<br />
    >>>>>> Table: ipf3_meta<br />
    >>>>>>>>> Creating table<br />
    >>>>>>>>>>>> Done<br />
    >>>>>> Table: ipf3_posts<br />
    >>>>>>>>> Adding column: post_id<br />
    >>>>>>>>>>>> SQL ERROR! See the error log for more detail<br />
    >>>>>>>>> Adding column: forum_id<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Adding column: topic_id<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Adding column: poster_id<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Adding column: post_text<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Adding column: post_time<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Adding column: poster_ip<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Setting default on column: post_status<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Changing column: post_status<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Adding column: post_position<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Dropping index: PRIMARY<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Adding index: PRIMARY<br />
    >>>>>>>>>>>> SQL ERROR! See the error log for more detail<br />
    >>>>>>>>> Adding index: topic_time<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Adding index: poster_time<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Adding index: post_time<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Adding index: post_text<br />
    >>>>>>>>>>>> Done<br />
    >>>>>> Table: ipf3_terms<br />
    >>>>>>>>> Changing column: term_id<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Changing column: name<br />
    >>>>>>>>>>>> Done<br />
    >>>>>> Table: ipf3_term_relationships<br />
    >>>>>>>>> Changing column: object_id<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Changing column: term_taxonomy_id<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Adding column: user_id<br />
    >>>>>>>>>>>> Done<br />
    >>>>>> Table: ipf3_term_taxonomy<br />
    >>>>>>>>> Changing column: term_taxonomy_id<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Changing column: term_id<br />
    >>>>>>>>>>>> Done<br />
    >>>>>>>>> Changing column: parent<br />
    >>>>>>>>>>>> Done<br />
    >>>>>> Table: ipf3_topics<br />
    >>>>>>>>> Creating table<br />
    >>>>>>>>>>>> Done</p>
    <p>Step 2 - WordPress integration (optional)<br />
    >>> WordPress address (URL): http://ipfcubed.com/<br />
    >>> Blog address (URL): http://ipfcubed.com/<br />
    >>> WordPress cookie keys set.<br />
    >>> WordPress "auth" cookie salt set from input.<br />
    >>> WordPress "logged in" cookie salt set from input.<br />
    >>> Fetching missing WordPress cookie salts.<br />
    >>>>>> WordPress "secure auth" cookie salt not set.<br />
    >>> User database table prefix: ipf3_</p>
    <p>Step 3 - Site settings<br />
    >>> Site name: IPF³ Forum<br />
    >>> Site address (URL): http://forum.ipfcubed.com/<br />
    >>> From email address: jordanspencer@ipfcubed.com<br />
    >>> Key master role assigned to existing user<br />
    >>>>>> Username: admin<br />
    >>>>>> Email address: jordanspencer@ipfcubed.com<br />
    >>>>>> Password: Your existing password<br />
    >>> Description: Just another bbPress community<br />
    >>> Forum name: The General of Electric<br />
    >>>>>> Topic: Your first topic<br />
    >>>>>>>>> Post: First Post! w00t.<br />
    >>> Key master email sent

    There were some errors encountered during installation!

    ERRORS:

    SQL ERROR!<br />
    >>> Database: jordan_wp (localhost)<br />
    >>>>>> ALTER TABLE <code></code>ipf3_posts<code>ADD COLUMN</code>post_id

    bigint(20) NOT NULL auto_increment;

    >>>>>> Incorrect table definition; there can be only one auto column and it must be defined as a key

    SQL ERROR!

    >>> Database: jordan_wp (localhost)

    >>>>>> ALTER TABLE ipf3_posts ADD PRIMARY KEY (post_id);

    >>>>>> Key column ‘post_id’ doesn’t exist in table

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)

  • chrishajer
    Participant

    @chrishajer

    Hopefully you have a database backup since that will be the easiest way to fix this. If you used the same database prefix for WordPress and your bbPress installation, bbPress tried to install into some existing WordPress tables.

    Here is a list of the tables created by both packages:

    bbPress tables:

    forums
    meta
    posts
    terms
    term_relationships
    term_taxonomy
    topics
    users
    usermeta

    WordPress tables:
    terms
    term_taxonomy
    term_relationships
    comments
    links
    options
    postmeta
    posts
    users
    usermeta

    From that list, it looks like the following tables have the same names in bbPress and WordPress:

    posts
    terms
    term_relationships
    term_taxonomy
    users
    usermeta

    So, if you used the same prefix, I think bbPress would just happily write into those tables. I’ve never done it, so I’m not certain, but I think that’s what would happen.

    I guess it’s possible also that it just leaves the existing WordPress tables alone, but the tables are not usable in bbPress, so there could be weirdness. It’s also possible that bbPress tries to alter the tables and fails in some places, making the table unusable for bbPress and probably WordPress.

    It’s easiest to just replace the database with a recent backup. If you don’t have that, then you will have to look at the database directly with a tool like phpMyAdmin and see exactly what happened.

    Luckily my system administrator makes automatic backups of the databases, so he just dropped all of the tables and then restored my database from about a day before. After a lot of research, I found it was basically impossible to restore the affected tables without a backup because not only did it change a lot of stuff I didn’t understand with some of the columns and the index of the posts table, but it changed every single “post_status” entry to “0″ instead of what they should be– “publish,” “draft,” and etcetera. Anyway, things were really messed up.

    My advice to anyone who has a similar problem and comes across this post is:

    A.) Look before you leap! Go over your settings many times before installing!

    B.) Backup the databases regularly and especially when installing or upgrading!

    Thank you, crishajer, for your help. I greatly appreciate the time you took. Again, thank heaven for sysadmins with more sense than site administrators! :)

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.