WordPress

Welcome to WordPress. Since you’re upgrading from b2 everything should be relatively familiar to you. Here are some notes on upgrading:

Have you looked at the readme? If you’re all ready, let’s go!

Step 1

Okay first we’re going to set up the links database. This will allow you to host your own blogroll, complete with Weblogs.com updates.

Installing WP-Links.

Checking for tables...

links) $got_links = true; if ($row[0] == $wpdb->linkcategories) $got_cats = true; //print "Table: $row[0]
\n"; } if (!$got_cats) { echo "

Can't find table '$wpdb->linkcategories', gonna create it...

\n"; $sql = "CREATE TABLE $wpdb->linkcategories ( " . " cat_id int(11) NOT NULL auto_increment, " . " cat_name tinytext NOT NULL, ". " auto_toggle enum ('Y','N') NOT NULL default 'N', ". " PRIMARY KEY (cat_id) ". ") "; $result = mysql_query($sql) or print ("Can't create the table '$wpdb->linkcategories' in the database.
" . $sql . "
" . mysql_error()); if ($result != false) { echo "

Table '$wpdb->linkcategories' created OK

\n"; $got_cats = true; } } else { echo "

Found table '$wpdb->linkcategories', don't need to create it...

\n"; $got_cats = true; } if (!$got_links) { echo "

Can't find '$wpdb->links', gonna create it...

\n"; $sql = "CREATE TABLE $wpdb->links ( " . " link_id int(11) NOT NULL auto_increment, " . " link_url varchar(255) NOT NULL default '', " . " link_name varchar(255) NOT NULL default '', " . " link_image varchar(255) NOT NULL default '', " . " link_target varchar(25) NOT NULL default '', " . " link_category int(11) NOT NULL default 0, " . " link_description varchar(255) NOT NULL default '', " . " link_visible enum ('Y','N') NOT NULL default 'Y', " . " link_owner int NOT NULL DEFAULT '1', " . " link_rating int NOT NULL DEFAULT '0', " . " link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', " . " link_rel varchar(255) NOT NULL default '', " . " link_notes MEDIUMTEXT NOT NULL default '', " . " PRIMARY KEY (link_id) " . ") "; $result = mysql_query($sql) or print ("Can't create the table '$wpdb->links' in the database.
" . $sql . "
" . mysql_error()); $links = mysql_query("INSERT INTO $wpdb->links VALUES ('', 'http://wordpress.org/', 'WordPress', '', '', 1, '', 'Y', 1, 0, '0000-00-00 00:00:00', '');"); $links = mysql_query("INSERT INTO $wpdb->links VALUES ('', 'http://photomatt.net/', 'Matt', '', '', 1, '', 'Y', 1, 0, '0000-00-00 00:00:00', '');"); $links = mysql_query("INSERT INTO $wpdb->links VALUES ('', 'http://zed1.com/b2/', 'Mike', '', '', 1, '', 'Y', 1, 0, '0000-00-00 00:00:00', '');"); if ($result != false) { echo "

Table '$wpdb->links' created OK

\n"; $got_links = true; } } else { echo "

Found table '$wpdb->links', don't need to create it...

\n"; echo "

... may need to update it though. Looking for column link_updated...

\n"; $query = "SELECT link_updated FROM $wpdb->links LIMIT 1"; $q = @mysql_query($query); if ($q != false) { if ($row = mysql_fetch_object($q)) { echo "

You have column link_updated. Good!

\n"; } } else { $query = "ALTER TABLE $wpdb->links ADD COLUMN link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'"; $q = mysql_query($query) or mysql_doh("Doh, couldn't add column.", $query, mysql_error()); echo "

Added column link_updated...

\n"; } echo "

Looking for column link_rel...

\n"; $query = "SELECT link_rel FROM $wpdb->links LIMIT 1"; $q = @mysql_query($query); if ($q != false) { if ($row = mysql_fetch_object($q)) { echo "

You have column link_rel. Good!

\n"; } } else { $query = "ALTER TABLE $wpdb->links ADD COLUMN link_rel varchar(255) NOT NULL DEFAULT '' "; $q = mysql_query($query) or mysql_doh("Doh, couldn't add column.", $query, mysql_error()); echo "

Added column link_rel...

\n"; } $got_links = true; } if ($got_links && $got_cats) { echo "

Looking for category 1...

\n"; $sql = "SELECT * FROM $wpdb->linkcategories WHERE cat_id=1 "; $result = mysql_query($sql) or print ("Can't query '$wpdb->linkcategories'.
" . $sql . "
" . mysql_error()); if ($result != false) { if ($row = mysql_fetch_object($result)) { echo "

You have at least 1 category. Good!

\n"; $got_row = true; } else { echo "

Gonna insert category 1...

\n"; $sql = "INSERT INTO $wpdb->linkcategories (cat_id, cat_name) VALUES (1, 'General')"; $result = mysql_query($sql) or print ("Can't query insert category.
" . $sql . "
" . mysql_error()); if ($result != false) { echo "

Inserted category Ok

\n"; $got_row = true; } } } } if ($got_row) { echo "

All done!

\n"; } ?>

Did you defeat the boss monster at the end? Good, then you’re ready for Step 2.

Step 2

First we’re going to add excerpt, post, and password functionality...

posts ADD COLUMN post_excerpt text NOT NULL;"; $q = $wpdb->query($query); // 0.71 mods $query = "ALTER TABLE $wpdb->posts ADD post_status ENUM('publish','draft','private') NOT NULL, ADD comment_status ENUM('open','closed') NOT NULL, ADD ping_status ENUM('open','closed') NOT NULL, ADD post_password varchar(20) NOT NULL;"; $q = $wpdb->query($query); ?>

That went well! Now let's clean up the b2 database structure a bit...

posts DROP INDEX ID"; $q = $wpdb->query($query); ?>

One down, two to go...

So far so good.

posts DROP post_karma"; $q = $wpdb->query($query); flush(); ?>

Almost there...

users DROP INDEX ID"; $q = $wpdb->query($query); upgrade_all(); ?>

Welcome to the family. Have fun!