The most elegant method of moving data between b2 and wp is to use the old b2 tables and run the import-b2.php. The only catch is to make sure that the wp table prefix is the same as your b2 and the database names are the same in the config files.
However, now that you have made yourself a new WP , here are my suggestions. PLEASE READ THROUGH ALL THE INSTRUCTIONS TO SEE THE CAVEATS AND PITFALLS
1) You are going to need more than just the b2posts table to get your entries to move over correctly, so think about copying b2categories, b2posts and b2users (while you are at it, I would copy the b2comments and the b2settings as well, just for good measure)
2) Now that you have created a new WP database, I am assuming that it does not contain any new entries. In order for the data to be successfully moved using this first method, you will HAVE TO HAVE the same table and table prefixes as b2. So, because it looks like your b2 tables had the ‘b2’ perfix, make that change in wp-config.php as well.
3) Install phpMyAdmin from http://www.phpmyadmin.net/home_page/ and get it working correctly.
4) Once installed, click on the dropdown menu on the left hand frame and click on your database. Now on the right, click on the export tab and Click on the tables you want to export from the table list. Accept all default checkbox settings (SQL, Structure, Enclose table names in backquotes and data checked) but also make sure the ‘Save as File’ is checked. Export the data to your local computer (this is also a very good way to backup your mysql data.
5) Now find the new wordpress database on the left dropdown menu. Click on the SQL tab on the right and browse for your newly created SQL file and click go.
6) Run import-b2.php
Caveats: You could perform the same export table by table and import table by table. In that case you could name your table prefix with anything you want to.
If you replace your wp-config.php table prefix now, your WordPress installation will stop working and new one will be created with the new table prefix and all of your b2 data
Be careful when you move data around in mysql, if phpMyadmin asks you any questions that really confuse you or worry you, you should stop and check around. However, you said you were conversant with mysql, so I will leave you here.
Also, I couldnt tell from your post whether you used a new database or the same one from b2 to install WP. The instructions here assume that you created a new database for WP.
Peace
Thanks LL! My host already has phpmyadmin installed and I’d already done dumps of my data, so I’ve got that covered. I only get one database, though, so have the b2_ tables and the wp_ tables in the same database.
I only have 1 user (me) and 4 categories, and I’ve tweaked the settings in WP already.
It sounds like I can just import the b2posts into wp_posts, then? I think I’ll try doing this on a local copy of WP and see what happens… I’ve never used MySQL before…we use Oracle at work (and sometimes SQL Server) so I’m ok with SQL syntax, but not the specific MySQL dialect. And I’m certainly no DBA! 🙂
I’ll let you know how it all works out, and again, than you for the detailed reply. Its much appreciated.
I tried the upgrade file (import-b2.php) and got a) no result or b) errors or c) worse 😉
Seems that by manipulating tables via PhpMyAdmin is the solution, though it must be done really carefully. Way to do it safely ? Backup b2 tables. Remove. Install WP, backup wp tables. Dump b2 tables. Work on them. Should be all right…
iampetesmith, I love you ^__^ err… well, a bit, at least… 😛 I should have thought of that myself ^__^, Must have been too tired to think properly …
Amy
(@beachgerl)
Hi, I’m following your instructions to the T (I think), LaughingLiza, but there’s this error. The error from phpMyAdmin said:
“Error
SQL-query :
CREATE TABLE b2categories
(
cat_ID
int( 4 ) NOT NULL AUTO_INCREMENT ,
cat_name
tinytext NOT NULL ,
KEY cat_ID
( cat_ID
)
) TYPE = MYISAM AUTO_INCREMENT = 15
MySQL said:
Table ‘b2categories’ already exists”
You see, I set up in wp-config.php to have the same b2 prefix as the old b2 tables. Yet the error said the b2categories already exists because there’s already a b2categories in the new WP database. Was I supposed to do that or create different tables? I’m a little confused here. I’d appreciate for any assistance on this. I already backed up everything so I have nothing to worry about and I’m upgrading from b2 .0.6.2 to WP. Thanks.
Amy
(@beachgerl)
Never mind…I got it all figured out and is up and running smoothly without snags so far. A breather helped. 😉 This is GREAT program, much better than b2 in comparsion. I’m glad I upgraded to WP. Great job to developers who created this software.