2 of 2
2
Import Textpattern into EE
Posted: 21 May 2007 01:03 PM   [ Ignore ]   [ # 19 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  828
Joined  10-14-2005

...and although you don’t have this problem because I know you use d.el.ic.io.us (forgive me I can never remember where the dots go so I threw a few extra in for good measure) I think it would be easy to adapt this approach to export the links list from Textpattern and import it into a weblog (section) with custom entry fields. I’m going to give that a shot too and post my results here.

 Signature 

Nathan Pitman - Nine Four

Follow me on Twitter - Try my EE plug-ins and extensions

Profile
 
 
Posted: 21 June 2007 09:05 AM   [ Ignore ]   [ # 20 ]  
Summer Student
Total Posts:  3
Joined  12-13-2002

Jon and Nathan, thanks for this thread—I’m about to migrate a couple of my Txp sites to EE, and it’s nice to find you two pros leading the way.

Profile
 
 
Posted: 22 June 2007 08:33 PM   [ Ignore ]   [ # 21 ]  
Summer Student
Avatar
Total Posts:  30
Joined  10-11-2006

In case anyone is still supporting the export method.. I tried it and the entries worked fine, but it only imported one comment per article, the first comment.
My export data is here http://www.adventures-in-motherhood.com/export I think everything looks ok, and it imports without a problem, but then most of the comments are missing. can anyone help with this?

thanks!

Profile
 
 
Posted: 22 June 2007 08:36 PM   [ Ignore ]   [ # 22 ]  
Administrator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  39808
Joined  05-14-2004

Hey, shaz!

Looking at the source of your page, the comments have no dashes between them.  If you compare your export to the official mt import format you’ll note that each comment is separated by

——-

5 dashes I think that counts as.  There are 0 dashes between yours so it doesn’t know a new comment has begun. I suspect that tweaking that will get you fixed up =)

 Signature 
Profile
MSG
 
 
Posted: 22 June 2007 08:45 PM   [ Ignore ]   [ # 23 ]  
Summer Student
Avatar
Total Posts:  30
Joined  10-11-2006

thank you, thank you Lisa!!!! works! smile

Profile
 
 
Posted: 22 June 2007 08:56 PM   [ Ignore ]   [ # 24 ]  
Administrator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  39808
Joined  05-14-2004

Glad to hear it =)

 Signature 
Profile
MSG
 
 
Posted: 26 April 2008 11:11 AM   [ Ignore ]   [ # 25 ]  
Summer Student
Total Posts:  7
Joined  04-26-2008

Thank you for all the details expressed so far in this thread. 

I’m having an issue with the MT Importer Utility however. I’m getting the error “Unable to Import Entries”, and I traced this to the code starting at line 814 of cp.mt_import.php which states that “At Least One Field Must Be Used”.

If the MT import posts don’t have categories, should “-none-” be selected?  I’ve tried a great number of combinations of settings without any luck.

Perhaps I’m looking at this the wrong way.  Any help here would be greatly appreciated!!

The file I’m attempting to import looks like this:
TITLE: Title
AUTHOR: striderz
DATE: 04/25/2008 02:54:50 PM
——-
BODY:
test test
test test
——-
————

Profile
 
 
Posted: 26 April 2008 04:52 PM   [ Ignore ]   [ # 26 ]  
Summer Student
Total Posts:  7
Joined  04-26-2008

Also, from the area of code that is catching the error in my import, what does ${$name} do?  I believe $name just holds a string in this context.

Thanks
striderz

Profile
 
 
Posted: 28 April 2008 08:27 AM   [ Ignore ]   [ # 27 ]  
Summer Student
Total Posts:  7
Joined  04-26-2008

I’m still investigating the issue I’m having here.  If anyone has insight into what the portion of code in the section “At Least One Field Must Be Used” in cp.mt_import.php that gives me the error “Unable to Import Entries” is checking for, that should put us in the right direction towards figuring this out.

Also, I’m working with Build:  20080319.  Let me know if there are any other details I can provide that would be useful.

Thanks!

Profile
 
 
Posted: 02 May 2008 11:14 AM   [ Ignore ]   [ # 28 ]  
Grad Student
Rank
Total Posts:  50
Joined  04-16-2008

Hi folks -


just wondering if we need to bump this issue over to support?

here are some additional parameters
we have MSM with 2 active sites. all sites reside on the same server.
the server uses Plesk 7.1.1

As you can imagine being able to import entries is key to our migration process..

striderz - 26 April 2008 11:11 AM

Thank you for all the details expressed so far in this thread. 

I’m having an issue with the MT Importer Utility however. I’m getting the error “Unable to Import Entries”, and I traced this to the code starting at line 814 of cp.mt_import.php which states that “At Least One Field Must Be Used”.

If the MT import posts don’t have categories, should “-none-” be selected?  I’ve tried a great number of combinations of settings without any luck.

Perhaps I’m looking at this the wrong way.  Any help here would be greatly appreciated!!

The file I’m attempting to import looks like this:
TITLE: Title
AUTHOR: striderz
DATE: 04/25/2008 02:54:50 PM
——-
BODY:
test test
test test
——-
————

Profile
 
 
Posted: 18 August 2008 04:22 PM   [ Ignore ]   [ # 29 ]  
Grad Student
Avatar
Rank
Total Posts:  98
Joined  04-14-2006

@dreas did you get this to work? I get the same problems as you. Great post if it worked.

I know it worked previously, wonder what we missed / or has changed?

Profile
 
 
Posted: 18 August 2008 06:01 PM   [ Ignore ]   [ # 30 ]  
Grad Student
Rank
Total Posts:  50
Joined  04-16-2008

yes we got it to work….
by completely reinstalling EE. the MSM and then all patches and updates.
and then we imported before activating any modules or plugins…
IOW it was a Maj. PITA

works a charm now. Unfortunately - due to the belt & suspenders approach -I can’t tell you exactly what was causing the issue.

8>

Profile
 
 
Posted: 22 August 2008 06:20 AM   [ Ignore ]   [ # 31 ]  
Grad Student
Avatar
Rank
Total Posts:  98
Joined  04-14-2006

O.k I got this to work too, last week.

Not sure quite how I did it… I have a horrible feeling I copied the text from the browser first time. Second time (which worked) I copied the source.

Maybe someone should hand me a wooden spoon!

Profile
 
 
Posted: 20 September 2008 03:51 AM   [ Ignore ]   [ # 32 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  828
Joined  10-14-2005

Just upgraded my ancient EE install for nathanpitman.com in advance of giving this a proper shot… it’s now or never… wish me luck.

 Signature 

Nathan Pitman - Nine Four

Follow me on Twitter - Try my EE plug-ins and extensions

Profile
 
 
Posted: 28 February 2009 06:04 PM   [ Ignore ]   [ # 33 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  828
Joined  10-14-2005

Ok, I’ve managed to overcome my final stumbling block with migration from Textpattern to ExpressionEngine. I wanted to persist the article IDs from TXP to EE because they are used in my permalink URLs. Basically I don’t want to break the internet (or my small part of it) by altering the URL structure in the switch.

Here’s what I did.

Open ‘cp.mt_import.php’ form within ‘/system/cp/’ then at line 954 add:

$ids = array();

at about line 1028 add:

// IDs Hack
                
if (strpos($parts['0'],'ID') !== false)
                
{
                    $ids[$id]
= trim(str_replace('ID:','',$first_section[$i]));
                
}

At about line number 1765 amend the entry id value to:

'entry_id'               => $ids[$id],

Now save and upload your amended import script. Back in Textpattern you also need to add one new line to the top of your export script.

ID: <txp:article_id />

So your TXP export will now include the original article ID and the import process will maintain this (so long as you have deleted all other weblog entries prior to import).

Happy migrating!!!

 Signature 

Nathan Pitman - Nine Four

Follow me on Twitter - Try my EE plug-ins and extensions

Profile
 
 
Posted: 14 December 2009 01:02 PM   [ Ignore ]   [ # 34 ]  
Summer Student
Avatar
Total Posts:  23
Joined  11-24-2008

I know this is an older post but I am currently trying to accomplish this task as well.  My textpattern articles have a lot of custom fields that are vital.  Is there anyway to import these as well.  What format would i follow to name the fields in ee so it knows what goes with what?

Profile
 
 
Posted: 14 December 2009 04:10 PM   [ Ignore ]   [ # 35 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  828
Joined  10-14-2005

Hi Phil, I don’t remember for sure but I’m pretty sure you get to map fields at some point… I could be mistaken though. In any case if you didn’t see it already check out the series of blog posts I wrote to document my migration from Textpattern to ExpressionEngine… a concise write up of all the steps documented here really… smile

http://nathanpitman.com/552/blogging-the-migration-from-textpattern-to-expressionengine

 Signature 

Nathan Pitman - Nine Four

Follow me on Twitter - Try my EE plug-ins and extensions

Profile
 
 
Posted: 14 December 2009 06:59 PM   [ Ignore ]   [ # 36 ]  
Summer Student
Avatar
Total Posts:  23
Joined  11-24-2008

Thanks.

I managed to figure it out from reading several things. Your posting was very helpful.  I will post what i did here for others.

First read the posts above for the basics, then for custom fields.

open your system/cp/cp.mt_import.php file

around line 50 find var $extra_fields = 0; and change the number to how many custom fields you have.

Then in your txp form you are using to create the export use this format

<txp:if_custom_field name="address">EXTRA FIELD-1: <txp:custom_field name="address" />
<
txp:php>echo "-----"."\n";</txp:php></txp:if_custom_field>
<
txp:if_custom_field name="city">EXTRA FIELD-2: <txp:custom_field name="city" />
<
txp:php>echo "-----"."\n";</txp:php></txp:if_custom_field>
<
txp:if_custom_field name="province">EXTRA FIELD-3: <txp:custom_field name="province" />
<
txp:php>echo "-----"."\n";</txp:php></txp:if_custom_field>

substituting the name of your custom fields obviously

couple of other tips which would have helped me at the end of each complete entry (article) there needs to be 8 dashes and a carriage return.  This is important if the carriage return is not there the import will fail.

If you are importing categories be sure to assign a category group to your weblog first as well as the custom fields you will be importing.  When you use the utility you can map which EXTRA FIELD belongs to which custom field.

Another useful bit.  If you are using RSS_unlimited categories on your textpattern site (as many people did) here is a little hack you can use to output all of the categories your article is filed under.  Not sure how great it would work if you have parent categories.

Go to admin > plugins and edit the rss unlimited plugin

We are going to alter the rss_unlimited_categories_filedunder portion of things.  Warning this will temporarily mess up your site if it is live but you can output your info and then change it back quickly after.  Speaking of which copy the text of the plugin and paste it into a blank text editor doc so you can quickly restore to the original.

Around line 173 you are looking for

$cats[]=tag(htmlspecialchars($b['title']),'a',' href="'.$path.'" title="'.htmlspecialchars($b['title']).'"');

What this is doing is outputing a link to the category with its name.  All we want is the basic category name.  So we will change this tag to

$cats[]=$b['name'].n;

This will export just the name of the category when we use the tag.

Then in our export form we will use this

PRIMARY CATEGORY: <txp:rss_uc_filedunder break="CATEGORY: " />

The break is meant to be something like li but it works well for our purposes.

I know that is a little long but hopefully it helps someone else out there.

Profile
 
 
   
2 of 2
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 02:47 PM
Total Registered Members: 115027 Total Logged-in Users: 113
Total Topics: 122462 Total Anonymous Users: 64
Total Replies: 647373 Total Guests: 495
Total Posts: 769835    
Members ( View Memberlist )