Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[issue] categories not importing properly (wordpress)
Hey all,
I am working on switching from wordpress to textpattern, and seem to be getting stuck on the importing process. all of my posts are switching over with no problems, but the categories don’t seem to be coming over as easily. The import script says they come over with no issues, and list them all by name in said script…
When I navigate to the “organize” section to show article categories, the imported categories are being listed, but instead of a hyperlinked name, it shows what appears to the the count of articles associated with the category (not hyperlinked/ able to edit).
When I list the articles, the category names are listed in the cat1 and cat2 fields, but if I go to edit the article entry, the category dropdowns are not properly populated (there are places for the categories in the droplist but they are all blank).
has anyone else encountered this issue? Any help would be much appreciated.
thanks!
-Chris
P.S. while on the topic, how many “root” entries are supposed to show up in the txp_category table?
Last edited by ckelly5 (2005-11-07 06:50:08)
Offline
Re: [issue] categories not importing properly (wordpress)
update on this: it looks like the import script should be taking different columns on the import.
currently, the import script is taking in the wp_categories.cat_name and putting that in the txp_category.name column
if you do a:
“SELECT wp_categories.cat_name, wp_categories.category_nicename FROM wp_categories” on a wordpress db,
it looks like the import script should really map the wp_categories.category_nicename to the txp_category.name and map wp_categories.cat_name to txp_category.title. I’ll try and verify this tonight.
Offline
#3 2005-11-07 22:35:36
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [issue] categories not importing properly (wordpress)
Thanks. I think the import script was written for an older version of Wordpress, and the database schema has changed since then.
That’s likely to be an ongoing problem; I’m not sure we can support direct database import in the long term.
BTW: is anyone able to supply the dev team with a sample WP database and/or MT import file for testing purposes?
Last edited by zem (2005-11-07 22:36:38)
Alex
Offline
Re: [issue] categories not importing properly (wordpress)
Success!
I was able to import the categories properly. Everything seems to be in order on the import side.
<a href=“http://www.ckelly.net/files/import_wp.php.txt”>Here</a> is the modified source if anyone wants it. (this is for importing a Wordpress 1.5 DB).
It’d also be cool to add an “import as user” option to the import script. I just hardcoded it to me when i did mine, but i could see others wanting that.
Offline
#5 2005-11-08 14:32:07
- jackson
- Member
- Registered: 2005-10-01
- Posts: 14
Re: [issue] categories not importing properly (wordpress)
I am trying to do this exact same thing. I have downloaded ckelly5’s updated script and run it from /textpattern/include/convert but nothing happens. I don’t get any prompts for the WP database info. I looked through the script to see if I’m supposed to insert these variables in there, but I don’t see where to do it. Is there something else I’m supposed to be doing? Thanks!
Offline
Re: [issue] categories not importing properly (wordpress)
You need to go to admin-> import in the textpattern administration section, then select wordpress from the “Import from” section. You will then be prompted for the db info. enter it, select the section to import into and any other changes and press continue. My modified script will then run.
again, I tested this against a wordpress 1.5 DB, your mileage may vary, I accept no responsibility for data loss, always back up your DB first, yadda yadda yadda :)
good luck!
note: I did notice that my posts don’t appear in my page when I select the category from the drop down navigation, unless I say “On Front Page” for the section I imported into. Then all the articles appear when I view via category. I thought this may have been a side effect of my script but now I think this is more a textpattern “feature” than anything. I assumed that I could do a “blog” section and have the category dropdowns from there (and not show blog posts on the main page), but this may not be the case. I still think my script works properly.
Last edited by ckelly5 (2005-11-08 15:01:18)
Offline
Re: [issue] categories not importing properly (wordpress)
Thanks ckelly for the input.
I have checked in the changes you suggested:
http://dev.textpattern.com/changeset/1091
Looking forward to feedback from other users as well.
Offline
Re: [issue] categories not importing properly (wordpress)
glad to be of help :)
I’d love to help some more. let me know if there’s anything else I can do! :)
Offline
#9 2005-11-08 15:17:36
- jackson
- Member
- Registered: 2005-10-01
- Posts: 14
Re: [issue] categories not importing properly (wordpress)
doh
I feel silly. I forgot about the admin>import section part.
Thanks, ckelly, my import worked perfectly and for those articles that I had assigned more than one category to, this also worked fine.
Super job!
Offline
Re: [issue] categories not importing properly (wordpress)
heh…. anybody tried to import from WP 1.6-alpha-still-do-not-use? :p
I’m moving my massive WordPress blog over tonight thanks to some unrecoverable erros with my WP 1.6 blog…
Aaron Brazell
Editor/Writer, [url=http://www.technosailor.com]Technosailor.com[/url]
Offline
Re: [issue] categories not importing properly (wordpress)
Can I also suggest, from a test import a week or so again, that you add two more items to the comments stuff. Currently, Textpattern imports all comments and sets them all to visible. This is bad when a blog has thousands of spam marked as spam or otherwise not modified.
WordPress offers comment_approved as 0,1,spam. 0 is awaiting moderation. 1 is approved. spam is self explanatory.
I added below line 43:
“.$wpdbprefix.“comments.comment_approved as status
Added at approx line 147-148:
//Do some Comment Spam Mojo
$visible = ($status == 1) ? 1 : 0;
and changed line 158 to be:
visible = $visible”,$txplink) or $results[]= mysql_error();
Aaron Brazell
Editor/Writer, [url=http://www.technosailor.com]Technosailor.com[/url]
Offline
#12 2005-11-13 02:34:19
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [issue] categories not importing properly (wordpress)
Is the comment_approved field available in previous versions of WP?
Alex
Offline