alex brie . net

bloghez din 2003 despre mine, internet, prieteni si altele.

  • Blog
  • About
  • Contact
  • Articole preferate
  • Publicitate
  • Blogs
« Ruby on Rails - 1-2-3 to performance analysis
Curatenia de primavara… »

How to import Textpattern into Wordpress

March 30th, 2007 |

I’ve talked a bit about this before : in my years of blogging I switched from a Blogspot account to Livejournal and finally, in 2004, to a self-hosted stand-alone blog. The main criteria for my CMS-blogging engine back then was simple: does it have RSS? can I have several Sections; is it nice-looking? Textpattern had it all at the time and I went for it. But, after a while, Wordpress 1.5 came along and I started getting angry that it had all this power: plugins, community, easy-to-hack framework.

Bottom line, I’ve been dreaming for 2 years already to migrate my Textpattern blog into a Wordpress one, one that I could easily hack, extend and theme. Finally, the day before yesterday (March 31 2007) I pulled myself together and started doing it.

Have you ever wanted this? If so, then tough luck: the instructions over here suck; so does the info from this wp thread.

So, without much ado, here are my instructions on migrating Textpattern 4.0.4 to Wordpress 2.1:

Requests:

  • I wanted to keep the permalinks working - they were of the form http://alexbrie.net/myblog/blog/397/fornetti/ - my blog was located at http://alexbrie.net/myblog/, I had two main sections (4 in total, but only 2 had important articles) Words and Blog. So the texpattern permalink was like: domain_name/blog_directory/section_name/post_id/post_title.
  • Also, I wanted the address http://alexbrie.net/myblog/ to remain valid and point to a Wordpress section with my previously imported posts.
  • Third: in the myblog directory I also had the folders files and images that I wanted to keep - or else, my previous posts that contained images would have gone bad…

In order for the Wordpress permalinks to remain the same, first of all, the article-section associations would have to get imported, and the article ids should remain the same.

1. The first step was to save a dump of my Textpattern database: from my Dreamhost account I went to the phpMyAdmin page where I selected export database (as gzipped); remember to chack the Save DATA options as well.

2. On my home computer I had a working phpMyAdmin install, and a Wordpress 2.1 install; you can probably skip this step if you don’t want to test things locally at first; in the end, after the import process, I exported this local Wordpress database into a gzipped file which I reimported from within Dreamhost - this is the easiest way of copying a database from your computer to the Dreamhost one…

3. Now: if you are to try the Wordpress2.1 textpattern import script(found at wp-admin/import/textpattern.php), you’d be disappointed really fast: the script doesn’t work, it spits out plenty of errors and doesn’t get anything done. Textpattern.php script has a bug and wants (despite what it says in the beginning) the textpattern tables to be in THE SAME database as the wordpress ones. I did this part by hand: phpMyAdmin, go to the textpattern database, select the first table, go to options, select “move to database”, chose the wordpress database. Repeat and rinse for about 15 times (the number of textpattern tables); you don’t really need to do this for all the tables, but I did it for safety.

4. Rerunning the wordpress textpattern import script goes ok this time: articles are imported, so are users, categories, comments, etc. Still:

  1. the sections are not imported
  2. the articles ids are changed - we wanted them to stay the same, remember?
  3. the articles are imported in Textile formatting - this is the default markup language used by Textpattern; Wordpress, instead, uses HTML by default. Which makes all your imported articles look messy, without any formatting, without links and images.

4. So after quite a bit of hacking I put together a modified version of the textpattern.php import script: it imports the Textpattern Sections as Wordpress Categories and keeps the article ids the same; also, instead of importing the Body and the Excerpt for the articles(which by default are Textile), imports their HTML versions - thus making the article look nice.

Before I can use it, though, I’d have to clean up the Wordpress database - since I already imported stuff that I don’t like: from phpMyAdmin, in the wp database, select all the tables EXCEPT the users tables and the options table and “Empty” them.

Download: textpattern.txt script - rename it to textpattern.php, replace the existing wp-admin/import/textpattern.php (make sure to make a backup first) and rerun the process.

For me, it worked like a charm!

Are we done yet? Not quite:
5.I went to my Wordpress Admin interface and started tweaking the categories: since I managed to import my Blog and Words sections as categories, I edited all the remaining ones and specified those two as the parents (well you can only pick one parent, but you’ll manage); I also created a “root” category called “myblog” and specified it as the parent for Blog and Words. Now, my Wordpress categories hierarchy is a tree with the root “myblog”, it’s children “Blog” and “Words” and the rest of the children(leaves) being the remaining categories.

6. From the Permalink section in the Options tab from Wordpress, I chose /%category%/%post_id%/%postname%/ as the permalink structure. This matches, more or less, the initial domain_name/blog_directory/section_name/post_id/post_title aka http://alexbrie.net/myblog/blog/397/fornetti/ format.

Are these instructions enough for you? I hope so. If not, please drop me a comment. I don’t promise I can help you, but we can see…

Pe vremea asta…

  • 2007: Povestea ta…
  • 2007: Curatenia de primavara…
  • 2006: Read of the day
  • 2006: Licenta de programator
  • 2006: Istoria unui blogger

Daca esti nou pe aici, nu uita sa te abonezi la feedul meu RSS rss feed. Iti multumesc pentru vizita!

Articole inrudite

  • Ruby for daily chores: Extracting most frequent loto numbers (0)
  • Inca o schimbare de look (4)
  • Vodafone Passport este o mare TEAPA (8)
  • Vacanta… (2)
  • Une famille de canards (1)

Tags: Blog, cms, dev, hack, import, php, script, Textpattern, Tutorials, Wordpress


Postata in Textpattern, Tutorials, Wordpress | RSS 2.0 feed comentarii | Comenteaza; Trackback.

30 Responses to “How to import Textpattern into Wordpress”

  1. Gravatar Free Net Publishing:
    April 28th, 2007 at 11:56 am

    I’m also using WP since ‘04, but I’m always learning something new.

    -Mark

  2. Gravatar Seth:
    May 25th, 2007 at 9:44 am

    Thanks for these instructions.

    The textpattern.php was driving me nuts.

  3. Gravatar John:
    June 11th, 2007 at 12:07 am

    Thanks for this, as you say the standard textpattern.php doesn’t work. Thanks again.

  4. Gravatar james:
    June 13th, 2007 at 12:20 am

    thanks

  5. Gravatar Maria:
    June 25th, 2007 at 11:36 pm

    It’s not working for me. =( I’m trying to do it, but I get this error:

    Fatal error: Call to undefined function: register_importer() in /home/****/public_html/textpattern/wordpress/wp-admin/import/textpattern.php on line 917

  6. Gravatar David Hughes:
    June 29th, 2007 at 11:30 pm

    I get the same error as Maria above.

  7. Gravatar Alex:
    June 30th, 2007 at 7:35 am

    Could be something changed in the newest versions of Wordpress. I’ll take a look at it someday, but till then you’re on your own, sorry….

  8. Gravatar Maria:
    July 4th, 2007 at 8:41 am

    New problem now:

    I’ve gone through the “import” from the admin interface and right after I click “import posts” WP logs me out and resets my password.

    (followed all steps above, including replacing the textpattern.php and making sure they’re in the same database)

  9. Gravatar poetsch.org » Blog Archive » Textpattern raus. Wordpress rein.:
    July 5th, 2007 at 1:40 am

    […] Die alten URLs sollte funktionieren, dank dieses Migationsskripts […]

  10. Gravatar Mike Olbinski:
    July 18th, 2007 at 4:58 pm

    My script just wont select my database…what am I doing wrong here? I moved tables from the old TP DB to my new Wordpress DB, and gave it the same info, and the script just cannot find the DB.

  11. Gravatar Michael:
    July 22nd, 2007 at 2:26 am

    @ Maria (Comment No 8): Actually, the new import script from 2.2 works. However, if you - before importing TXP-articles - have already changed the username into the same username used in the TXP-database, its password is reset to password123. Either you log in with the new password or you just import everything and afterwards deal with usernames, etc…

  12. Gravatar patrick:
    August 5th, 2007 at 8:02 pm

    Thanks for this! I was having fits with the import in 2.2.2, your version did the trick.

  13. Gravatar openswitch » Importing Textpattern Into WordPress:
    August 14th, 2007 at 6:20 pm

    […] Subscribe August 14th, 2007 » How to import Textpattern into WordPress. For some reason the textpattern.php import script that ships with WordPress is buggy. This guy […]

  14. Gravatar David:
    October 17th, 2007 at 6:40 pm

    Hi.Thanks for your post .Your article make great idea to me.Thanks.

  15. Gravatar Selvam:
    October 29th, 2007 at 4:43 pm

    Simply great plugin for WP masters..

  16. Gravatar David:
    December 13th, 2007 at 4:56 pm

    Thank you for this - after drawing a deep breath I finally made the move to WP - and it’s saved a lot of work.

    I’m using the permalink structure /%category%/%postname% which worked a treat, just have to re-assign the Categories as they have all come in to the default one - but that was probably my fault somewhere.

    Cheers.

  17. Gravatar mk:
    December 25th, 2007 at 7:01 am

    is there a way to do it without having the username or password for the old database

  18. Gravatar Alex:
    December 25th, 2007 at 8:43 am

    mk - the username and passwd for the old db are stored in a config file in the textpattern/wordpress directory. Take a look in there and you’ll find them eventually

  19. Gravatar Mah Blog:
    February 15th, 2008 at 11:09 am

    […] out with an older version of Word Press because the default importer is rather borked. So, I found a blog post detailing how to correctly import the old DB. The reason that I had to have an old version (2.1, to […]

  20. Gravatar A new post at david hall:
    February 24th, 2008 at 3:37 pm

    […] anyone wants to know hoe to do this, see Alex Brie’s  great article. You don’t have to use the transfer your information to another database bit […]

  21. Gravatar lauren:
    March 9th, 2008 at 2:28 pm

    Thanks for this

  22. Gravatar David Hall » Blogging polygamy:
    March 10th, 2008 at 3:54 pm

    […] the method explained by Alex Brie I got WP up and running pretty quickly, only complicating matters myself by writing my own theme to […]

  23. Gravatar Code Frenzy » Blog Archive » Migrating from Textpattern to WordPress:
    March 24th, 2008 at 2:26 pm

    […] I found out that a few people have had issues with this script. A couple of other people (such as Alex Brie) have written their own instructions and even scripts (or at least modified the one that comes with […]

  24. Gravatar Joe Auricchio » Blog Archive » Back to WordPress:
    May 3rd, 2008 at 1:06 am

    […] opportunity for sanity checking. No warranties express or implied yadda yadda. Thanks to Alex Brie’s script for […]

  25. Gravatar Upoznati nekog:
    May 5th, 2008 at 3:24 pm

    Nice! Is it work at WP 2.5?

  26. Gravatar Seka Aleksic Fan:
    May 5th, 2008 at 3:25 pm

    Yes, I think it’s work!

  27. Gravatar Ben:
    May 13th, 2008 at 4:06 am

    @Upoznati nekog: Yes, it works with 2.5

  28. Gravatar Pixeleden - Hello WordPress!:
    June 20th, 2008 at 8:18 pm

    […] from Textpattern. Obviously, I did a Google search: “textpattern to wordpress” and the top result did the job very well! As you can see below the old posts are there […]

  29. Gravatar Pixeleden - Hell WordPress!:
    June 20th, 2008 at 8:23 pm

    […] my data from Textpattern. Obviously, I did a Google search: “textpattern to wordpress” and the top result did the job very well! As you can see below the old posts are there […]

  30. Gravatar katrina:
    July 6th, 2008 at 6:41 am

    thanks!

    It didn’t import everything (I had a bunch of plugins) but it imported what I needed!

Leave a Reply

  • Pe vremea asta...

    • 2007: Povestea ta…
    • 2007: Curatenia de primavara…
    • 2006: Read of the day
    • 2006: Licenta de programator
    • 2006: Istoria unui blogger
  • Despre Alex Brie

    View Alexandru Brie's profile on LinkedIn

    Bloger pasionat din septembrie 2003.
    Software engineer; master in cercetare algoritmica la Ecole Polytechnique Paris; a lucrat in Paris in software bursier.

    Inapoi in Romania din 2006, programeaza Ruby on Rails pentru un startup american, este consultant independent, blogger si antreprenor cu diverse proiecte online
    [afla mai multe..]

    Aboneaza-te RSS(Romanian)

      
    Acum te poti abona si prin email.

    Subscribe(English)

  • Urmareste-ma si pe Twitter

    • Recomand

      cele mai tari stiri de pe blogurilejurnal de fapte bune

    • Users Online

      • 20 Users Online
      • Users: 20 Users
    • Comentarii recente

      • katrina on How to import Textpattern into Wordpress
      • Andrei Maxim on 10 Ruby programming tips you should already know
      • Cu ce masini m-am dat in Romania | Cafeina.ro on On/Off road adventure - Concluzii Drive Test SSang Yong Rexton
      • farouk on Beginner’s blogging guide - How to bring traffic to your blog
      • limpede on Berea e placere ?!
      • Alsaru on Patine cu rotile - wishlist 1
      • Ibdreamy.com » Blog Archive » Twitter Apps, Plugins and Tools on TwitterYM - tiny ruby Yahoo Messenger status Twitter updater
      • Alex on Berea e placere ?!
      • Gelu on Berea e placere ?!
      • Skandalouz on Bucurie pura
      • Andrei on Bucurie pura
      • Alex on Cum voi castiga eu la loto :D
      • Alex on 10 Ruby programming tips you should already know
      • Piku on 10 Ruby programming tips you should already know
      • Anca on Caut Crocs
    • bloguri care ma citesc

      • Andrei.Voce.ro
      • Avram Seby
      • Blog ul lui Mage - mai acid decat clorhidricul
      • Blogatu
      • Bogdan’s Weblog
      • Costinu Rgbdesigners
      • cotofana.RO
      • dEsign.101
      • Dowel
      • Insemnari.ro
      • Kappacelu
      • LIMPEDE - blog
      • Mihai Nasaudean Blog
      • serban.us
      • www.liveMag.ro
    • Archives

    • TLA

      • party supplies
    • Categories

      • Blog (1320)
        • carcoteli (4)
        • English (14)
        • evenimente (6)
        • FILMS (33)
        • French (3)
        • fun (57)
        • intrebari (5)
        • jocuri (5)
        • masini (1)
        • masini (1)
        • matematica (1)
        • PHOTO (147)
          • desene (12)
          • flori (2)
          • oua rosii (1)
        • Projects (81)
          • business (31)
          • ROSI (12)
        • Promo (3)
        • Romanian (118)
          • aici (49)
          • repat (33)
        • scurte (10)
        • Software (23)
          • .mac (20)
        • stiati ca (4)
        • Stiri IT Media si Internet (51)
          • yahoo (1)
        • Technicalities (66)
        • Web (460)
          • links (150)
          • Memes (54)
          • video (58)
      • dev (21)
        • Open Source (1)
        • Rails (9)
        • Ruby (8)
        • Textpattern (2)
        • Tips and Tricks (9)
        • Tutorials (7)
        • Wordpress (6)
      • iPhone (7)
      • opinii (1)
      • recenzii (9)
      • tutoriale (1)
      • Words (133)
        • essays (32)
        • Politice (44)
        • vss[very short stories] (5)
    .mac aici antreprenoriat Apple Basescu Blog blogger bloggeri blogging blogosfera bloguri blogvertising booq bucuresti business carti ceausescu cleopatra stratan comics concurs conferinte Desktop-TD Digg evenimente feedburner FILMS flash fun ganduri Google internet intrebari iPhone iread IT jocuri Leopard links linkuri Manafu marketing marketonline market online masini mema Memes Microsoft muzica myblog Netcamp netstart olimpiade online oprescu OSX personal PHOTO politica Politice poze presa programare proiecte publicitate Rails repat review rexton roblogfest Romania Romanian ROSI Ruby script seo snippet software spam ssang yong stiri Techmeme testdrive Tips and Tricks triburi triburile tutorial Tutorials twitter Utopia viata viata mea video viral vodafone Web Wordpress Words yahoo yahoo messenger youtube

    Entries (RSS) and Comments (RSS).
    Theme inspired by CrunchNotes, by Alex Brie.

    Copyright © 2005-2008 alex brie . net. Unele articole pot contine tematici sau linkuri sponsorizate. Opiniile si idele sunt intodeauna ale autorului, care le imbratiseaza si le sustine.