Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-02-25 13:25:42

rollerbob
New Member
Registered: 2006-02-25
Posts: 3

Migrating to Textpattern from a home-brew MySQL/PHP blogging system

Hi all,

After using a home-made blogging system written in PHP and MySQL for 5 years, I’ve decided to migrate to Textpattern. The MySQL table is pretty simple:

id (int)
time (int)
modified (int)
title (varchar)
body (text)

I have a PHP script that dumps all my entries into an array, which I can loop through and populate the Textpattern table. I have around 2000 entries, and the ‘body’ field contains a mixture of Textile formatted text and HTML. My problem is how to deal with the Body and Body_html fields. I suppose I’ll need to grep for HTML tags and put those entries into the Body_html column, otherwise put Textile formatted posts into Body, then run them through Textile to populate the Body_html field.

Really, I’m just wondering if anyone has gone through a similar process and what’s the best approach to take.

Matt

Offline

#2 2006-02-25 19:33:55

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: Migrating to Textpattern from a home-brew MySQL/PHP blogging system

Check out <a href=“http://textpattern.com/faq/114/can-textpattern-import-entries”>FAQ: Can Textpattern import entries from…?</a> for some suggestions on how to get started. In particular:

<blockquote>If you need to import data from an application that isn’t supported here, your options are…</blockquote>

And welcome to Textpattern!

Last edited by Elenita (2006-02-25 19:34:38)

Offline

#3 2006-02-26 04:49:52

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Migrating to Textpattern from a home-brew MySQL/PHP blogging system

I’ve done this and here’s what I did: installed Textpattern and it’s tables. Then I altered my custom table structure to match the new Textpattern table, filled in any empty required fields, then imported the old table into the new one. I found the free SQLyog invaluable, as it makes it quick and easy to alter table structure.

Offline

#4 2006-03-01 20:22:13

rollerbob
New Member
Registered: 2006-02-25
Posts: 3

Re: Migrating to Textpattern from a home-brew MySQL/PHP blogging system

Thanks for your help. I managed to get it working with my script which I’d like to post here, but why is BBCode turned off?

Last edited by rollerbob (2006-03-01 20:26:13)

Offline

#5 2006-03-01 20:34:25

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: Migrating to Textpattern from a home-brew MySQL/PHP blogging system

Unfortunately, that’s just the way things are. There may be a more logical explanation for the lack of BBCode, but I dunno what it is.

Wrapping things in code tags should work.

Last edited by Elenita (2006-03-01 20:35:30)

Offline

Board footer

Powered by FluxBB