Recent Topics

blogger to b2 evolution import

Started by on Dec 17, 2003 – Contents updated: Dec 17, 2003

Dec 17, 2003 16:02    

Ok, I need to update from blogger and it's between b2 evo and movable type. at the moment, all i've been able to find for converting blogger to b2 is for the old, vanilla b2 version.

is there a script that will do this for b2 evo? could i use the older blogger-2-b2.php script? thanks, anyone!

Dec 17, 2003 19:05

I don't think there is any import tool for b2evo yet, but I'm not sure about it. The older script you mentioned only works for b2, not b2evo.

Hang on a bit, I'll see if I can turn that script into one that works with b2evo...

-Vegar

Dec 17, 2003 20:03

All right, I made some changes to that script, so it should work with b2evolution now. But I have to warn you, I haven't tested it, so you should back up everything that can be backed up before using it!

[url=http://funky-m.com/stuff/blogger-2-b2evo.zip]Click here[/url] to download it, if you want to give it a try.
Good luck! :)

-Vegar

Dec 18, 2003 07:37

If that doesn't work, why not just convert to b2 and then upgrade that to b2evolution? I upgraded my blogger in the dark and distant past to b2 and didn't have any problems upgrading to b2 and then to b2evolution...

Dec 18, 2003 08:36

boy, are you people ever smart!

thank you one million - i'm going to try out that script first and see what happens. :)

------------------------

later:

ok, so it might need a bit of tweaking. i followed the instructions and still couldn't find my posts, even though the script seemed to pick up on all the correct files.

so i went to the Users page, and found that a new user had been created, but the username was blank, so i had this (code formatting just looks better):

ID     Login     Nickname     Name     Email    URL    Level
1      admin     admin                                    10
2                                                      1 + - 

the email was as it should be from the php script, user@b2evolution.net. somehow my blog nickname got lost.

any ideas? i appreciate all that you've done so far, Funky-M!

Dec 18, 2003 12:39

The default login is admin anyway, no matter what you do. Just change your nickname on the users screen, or just create another login and set it to user level 10.

Dec 18, 2003 13:12

I don't think that would necessarily help... the point is that my posts are nowhere to be seen, and there's a mystery user that I can't log in as created by the script. I'm not worried by the mystery user, I'm just providing it as information that may help in solving where I went wrong.

Dec 18, 2003 13:21

I tried, at least. :|

It's very strange that it didn't work... all that I changed was some names, and swapped links to the old b2 config and function files with b2evo's (and I checked the variable and function "dependencies", too).

Maybe you could try like Graham said, install b2 first, use the blogger-2-b2.php script and then upgrade to b2evolution. That should work (although it'll take a bit of time).

Later on we should have/make some working scripts to migrate from at least Movable Type and Blogger to b2evolution, to make transitions like happeningfish's easier, don't you think?

-Vegar

Dec 18, 2003 13:21

The script might have misset something like post to user associations or sth like that. If something like this is missing, the SQL joins just won't pick the posts out of the DB.

Dec 18, 2003 13:24

Could you send me those xxxx_xx_01_b2evo.php files created by the script? (if you don't mind me reading them)
I'd like to take a closer look at this thing in the weekend, when I have more time to spare.

-Vegar

Dec 18, 2003 15:08

Oh boy, am I ever dumb.

(I bet you love it when messages start with that!)

So, I managed to make blogger publish my posts in a way that was actually PARSABLE by the lovely php script, and now I'm closer, it would seem. (I had oh-so-stupidly not changed my template template, but my archive template, which is quite useless.)

Closer, because now I'm getting this - it works with two years' worth of posts, and nearly at the end it gives me this...

2003/07 Duplicate entry '4294967295' for key 1

however, I've seen that this error has happened to other people, so I'm going to check it out on the boards and will post if my solution shows up...

Dec 18, 2003 15:17

So it works after all? Or what are you saying?

-Vegar

Dec 18, 2003 15:33

If you can access the db directly, please tell me what category they are listed as (in the table evo_posts). Then check to see if you have any categories with that number (evo_categories).

I supposed that all the posts ended up in demo blog A (blog_a.php), but maybe they didn't. :-/

-Vegar

Dec 18, 2003 15:40

okay, in the evo_posts table, under post_category, they all show up under 1. this does show up in the evo_categories table, as Announcements A.

www.happeningfish.org/test/blogs/
is where it lives, incidentally.

Dec 18, 2003 15:44

That's really strange.. Could you show me the attributes of a random imported entry? Maybe there's some clue there as to what happened when you imported.

-Vegar

Dec 18, 2003 15:55

here ya go, a golden oldie...

ID: 267973
post_author: 2
post_date 2000-05-26 15:08:34
post_status: published
post_lang: en_US
post_content: <a href="http://www.netscape.com">netscape 6</a>. ...
post_title: (blank field)
post_urltitle: NULL
post_url: NULL
post_category: 1
post_trackbacks: NULL
post_autobr: 1
post_flags: NULL
post_karma: 0
post_wordcount: NULL
post_comments: open

Dec 18, 2003 16:09

I know at least four post_flags that should have been set: pingsdone, tbdone, smileys, imported. [edit: and also 'html'] I should fix that with the script.

The odd thing is, I can't see anything in particular that's wrong, apart from that the post has no title. It should have displayed properly...

*cough* 267973 posts? 8| I'm not sure I believe that value has been set incrementally. :)

Dec 18, 2003 16:18

Incremental? Oh, sure!

No, there are 1121 posts to import, which is well on the way to 267973. I hope to reach 300000 by easter or so... ;)

Dec 18, 2003 16:29

Well, that shouldn't be a problem. I'm not sure exactly when easter is, but let's say (for simplicity) that it begins the first of may. That gives you the low low blogging rate of 2214 posts per day for 135 days straight, which any decent blogger should manage perfectly. lol. ;)

-Vegar

Dec 18, 2003 17:05

i'm still hella confused, but at least i'm finally getting over my fear of sql and php...

I went through, took that same random post, and tried to change some attributes, then went to see if I could view that post. the only thing that made a difference was entering text into the post_title field. now i can see the title i've just entered, but still no text.

http://www.happeningfish.org/test/blogs/blog_all.php?p=267973
lets me view it. interestingly,
http://www.happeningfish.org/test/blogs/blog_all.php?author=2
doesn't display that post. ditto for ?cat=1, and ?m=200005 also gives me nothing.

on top of this, i've noticed that none of the test posts i've entered through the b2/evo UI have shown up... but i didn't have that problem when i installed this before and didn't import posts. strange strange again.

Dec 19, 2003 05:38

Just an update...

I discovered through messy experimentation (I tried to import blogger into wordpress as well and had the exact same error; then noticed that I had problems viewing newly-created blogs in php) that my host is running php with Safe Mode switched on, which creates no end of headaches for anyone trying to run b2 evolution. My host is paranoid and that's that - so I've gone and installed movable type.

I'd invite anyone else to try Vegar's script, though - aside from my own messed-up server, I'll bet it works like a charm for someone else. Thanks for all your help, peeps! I wish I'd been able to get b2 to work because frankly, MT's support community sucks large compared with this one!

Dec 19, 2003 08:00

That's too bad. :( I was hoping maybe you could be the one to translate b2evolution to Finnish. :)

If you ever switch hosts, please come back here again, and Francois will probably have a shiny new version of b2evo ready for you to install. ;)
Good luck! (and merry Christmas!) :)

-Vegar

Dec 30, 2003 04:25

I've been following this thread and decided to give the blogger import script a try. However, I got the same results that happeningfish reported in his post dated December 18. Here's a snippet:

...<snip>...
2003/03 ... Done
2003/04 ... Done
2003/05 ... Done
2003/06 Duplicate entry '4294967295' for key 1
...<snip>...

When I grep the input files, that key number is not in any of them. Checking the user list, 277 entries show for this new user created by the import script, but as stated elsewhere in this thread, the entries don't show in any of the b2evo blogs.

Is the key number assigned dynamically by the script?
Has anyone tried importing one month / file at a time?
Have we found where the imported entries should be showing?

Looks like this script is close...! It would be fun to get it working!

- KSaff

Dec 30, 2003 12:07

Apparently that problem has been ravaging the b2 crowd as well - there's apparently a working solution over [url=http://tidakada.com/board/viewtopic.php?p=19725#19725]there[/url]. To quote the main point:
Aza wrote:

I *finally* found a working solution.
One has to change the posts ID from INT(10) to BIGINT(20) in the b2posts and b2comments table, using phpMyAdmin.

Then one need to find the following line in blog.header.php :
(this is line 98 with WordPress, havn't tried it on b2 yet)

$p= intval($p);

and comment it with a double slash :

// $p= intval($p);

I can probably get the import script to do the first bit automatically, and I'm not sure if the second bit applies to b2evolution. But at least it looks like a solution should be within reach. :)
I'll take a look into the conversion script in a few minutes.

-Vegar

Dec 30, 2003 12:09

Oh, and happeningfish is a girl. It's her post dated December 18. :))

-Vegar

Dec 30, 2003 12:44

Okay, clear out your evo_posts table (using for instance "DELETE FROM evo_posts;") and try [url=http://funky-m.com/stuff/blogger-2-b2evo.zip]the script[/url] now. It now automatically does an "ALTER TABLE" to fix the duplicate entry business. I haven't looked into the other fix, but I'm not sure it's neccessary with b2evo.

-Vegar

Feb 15, 2004 11:16

Hi Vegar, sorry to disturb you again with this problem.

I tried to import my old blogger files into my new b2evo blog (http://www.peikko.org/pornopolka) with the script you made. I managed to get Blogger publish the archives into /pornopolka, but when I clicked ok in the blogger-b2evo.php, it did nothing.

My B2evo is installed in different directory (/log) and I tried also run the script from there. Nothing. I tried with Mozilla Firefox and Ie.

Do you have a clue where the problem is?

Thousands of thanks!

Feb 15, 2004 13:58

What exactly did you see? Did you get any error messages?

If you have access to phpmyadmin, please go and check out the evo_posts table and tell me what you see.

-Vegar

Feb 18, 2004 21:47

I got just an blank page.

This is what my evo_posts looks like. I didn't understand quite much, but the copypaste is here to help.


 Field   	Type  	Attributes  	Null  	Default  	Extra  	Action
	 ID  	int(10) 	UNSIGNED 	No  	  	auto_increment  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 post_author  	int(4) 	  	No  	0  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 post_date  	datetime 	  	No  	0000-00-00 00:00:00  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 post_status  	enum('published', 'deprecated', 'protected', 'private', 'draft') 	  	No  	published  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 post_lang  	varchar(12) 	  	Yes  	NULL  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 post_content  	text 	  	No  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 post_title  	text 	  	No  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 post_category  	int(4) 	  	No  	0  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 post_trackbacks  	text 	  	Yes  	NULL  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 post_autobr  	tinyint(4) 	  	No  	1  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 post_flags  	set('pingsdone', 'pbdone', 'tbdone', 'html', 'bbcode', 'gmcode', 'smartquotes', 'smileys', 'glossary', 'imported') 	  	Yes  	NULL  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 post_karma  	int(11) 	  	No  	0  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 post_wordcount  	int(11) 	  	Yes  	NULL  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
With selected:    Or 

Indexes : [Documentation]
Keyname 	Type 	Cardinality 	Action 	Field
PRIMARY 	PRIMARY 	53  	Drop 	Edit 	ID
post_date 	INDEX 	None  	Drop 	Edit 	post_date
post_category 	INDEX 	None  	Drop 	Edit 	post_category
post_author 	INDEX 	None  	Drop 	Edit 	post_author
post_status 	INDEX 	None  	Drop 	Edit 	post_status

Create an index on  columns  
	  	Space usage :
Type 	Usage
Data 	51,736 	Bytes
Index 	6,144 	Bytes
Total 	57,880 	Bytes
	  	Row Statistic :
Statements 	Value
Format 	dynamic
Rows 	53
Row length ø 	976
Row size  ø 	1,092 Bytes
Next Autoindex 	63

Apr 09, 2004 07:11

Being a former blogger-user, I thought I'd finally give this a whirl. (My blogger blog was always on a separate page, and I didn't use it for that long, so it's no big deal to not have it carry over.)

The problem is the evo_postcats table.

Every post in b2evolution has an entry in the evo_postcats table, even if it only has one category. The script doesn't create these entries. (I suppose there was no postcats table in b2?) Thus, the joins in the b2evo system don't grab the converted posts.

Blogger doesn't sequentially number the post IDs. From one post to another, the IDs jump by thousands. Thus, when you run the script, even though it alters the table to make the ID a bigint(20) field, the "Next Autoincrement" value for the table in MySQL gets set to something huge, like 107200117126356374.

When you try to write a new post in b2evolution, it stores the new post ID with some huge number. Then it tries to make an entry in evo_postcats, but since the postcat_post_id field isn't also a bigint(20), it ends up only entering a small number when it's typecast. So 10^17 becomes 10^9. Thus, when the joins are done between evo_postcats and evo_posts, the new posts aren't picked up either.

So, if you run the script as is, your blogger posts will go into the database, but you won't be able to see them on the site, and you won't be able to post anything new and have that show up, either. The way that I corrected the problem was to

mysql>delete from evo_posts where id>10000;

and then backup the table, drop the table, change the BIGINT(20) to INT(20) in the backup.sql file, and then restore from the backup. (This reset the next auto-increment value to something more reasonable.)

Solution:
1) At the beginning of the script, query the database and store this value:

select max(ID) from evo_posts


2) As you're entering things into the database, instead of using blogger's ID as the ID value, either don't enter one at all (and the auto-increment should do it for you,) or start a counter at the max(id) value, and just have the script generate IDs sequentially. That way, the user won't be left with permalinks like:
http://isaac.beigetower.org/index.php?p=116092866323423421198
3) For every entry in evo_posts, make a corresponding entry in evo_postcats, with the ID and 1 (to link it to the first category.)
4) If any of the entries don't have a title, use something nice like "[Converted from Blogger]".

Of course, that'd have to be tested. (I gave up once I got back to where I had started, so I haven't tried any of this.)

Isaac Z. Schlueter
http://isaacschlueter.com

Oh, yeah, I forgot to mention:
Vegar, I'd be happy to be your QA guy on this, as you mentioned that you don't have a blogger blog set up to test.

Apr 17, 2004 20:26

Sure thing, Isaac. You've done some excellent research! I'll look more into this tomorrow, when I have less other stuff to do.
Thanks. ;)

-Vegar


Form is loading...

b2evolution CMS – This forum is powered by b2evolution CMS, a complete engine for your website.