You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
I'm currently porting an old proprietary custom CMS to Wordpress, and I'm attempting to move over the post data (contained in the content table) from the original CMS while retaining all the extra data that's contained in the old CMS content table's structure. Wordpress has a posts table that only contains the bare essentials, while the rest of the post data is stored in the postmeta table.
I have no problem creating the new Wordpress posts record, but my problem is that the posts table generates a new primary key, one that is not shared with the original content table.... and the postmeta table needs to be keyed on the key that the mysql DB generates.
Now I've figured out how to use tMysqlLastInsertID and OnSubjobOK to pass on the new key .... but I'm lost on this part:
..... How can I pass on the data from the content table when it's not keyed on the same ID?
I don't have anywhere to store the content row's primary key in the new posts row .... how can I get these two keys associated so I can return and extract the pertinent data from the content table to store in the postmeta table?
I'm at a complete loss of what to do, and this is a time sensitive project. Any help would be *greatly* appreciated.
Please ignore the "tos3.0.0" tag... that was a misclick ![]()
I should add, I'm using TOS Version: 4.2.2 Build id: r63143-20110622-0628
Offline
This is starting to seem like a hopeless cause. Does anyone have any clue what I'm doing wrong?
Offline
Hi
Can you upload a screenshot of job? It will be helpful for us understanding your problem.
Best regards
Shong
Offline
Shong, the problem is that I don't know how to structure my job. Showing you a screenshot of my current attempts would be fruitless as I know they're entirely wrong.
I can show you an example of want I want though (though my actual solution will contain many more fields):
Input table:
[content]
content.id
content.name
content.body
content.category
content.company
Output tables:
[posts]
posts.id
posts.name
posts.body
[postmeta]
postmeta.id
postmeta.postid
postmeta.metakey
postmeta.metavalue
Data flow:
posts.id = (automatically assigned by mysql)
posts.name = content.name
posts.body = content.body
(new postmeta record)
postmeta.id = (automatically assigned by mysql)
postmeta.postid = posts.id (as generated by the related posts insert)
postmeta.metakey = "old_id"
postmeta.metavalue = content.id
(new postmeta record)
postmeta.id = (automatically assigned by mysql)
postmeta.postid = posts.id (as generated by the related posts insert)
postmeta.metakey = "category"
postmeta.metavalue = content.category
(new postmeta record)
postmeta.id = (automatically assigned by mysql)
postmeta.postid = posts.id (as generated by the related posts insert)
postmeta.metakey = "company"
postmeta.metavalue = content.company
Last edited by ShaunWinters (2011-09-16 16:45:40)
Offline

I think what you want is:
content --> tMap -order1-> posts --> tMysqlLastInsertID --> tSetGlobalVar (to store the new ID)
-order2-> tSplitRow (separate into three records and put in the new ID from the globalMap) --> postmeta
You can't use the ID from the globalMap directly in tMap because of Don't populate output row until ready to execute branch.
Online
Well for now, as a workaround, (and against my better judgement) I've added a new field to the Wordpress posts table to store the old CMS content ID... I'm just running two separate processes now.
I'm blown away that I even had to resort to this kind of hack for such a seemingly simple task.
Offline
I'd still like to know how to do this properly, if anyone's willing to indulge me
Offline
Pages: 1