Importing data as object from another database

Author Message

Shurbann Martes

Wednesday 19 November 2003 6:32:17 am

Hello there,

I'm looking for an answer (way to start) to this problem:
I have a database with information that comes from another application I made. This application stores these information in another DB (so not the same DB as eZ is using).

Now I want to store some of these data into eZ as object. I looked around and found this in the forum:

http://www.ez.no/developer/ez_publish_3/forum/developer/creating_a_simple_content_object_via_php

That's exactly what I'm looking for, need a little bit of tweaking, but ok. Still I dont know how and where to put this little script (if I may call it so) .

Should I put it like in the cronjobs directory where it will be running using cron or somewhere else?. I would appreciate it if someone can shed some light on this.

TIA,
Shurbann

Claus Jensen

Wednesday 19 November 2003 7:08:52 am

Hi Shurbann,
I've done some importing of objects this way, as you may have seen on the thread you refer to. You should put this script in the root folder ezpublish, and there it may fetch ini-files from your installation. Ofcourse it may also be run from a cron-script is that is what you prefer, but for me it was a "one-time-job". Also, this was a flat-file import, exported into commaseparated or semicolon from the other database. Anyway, it is timing out after about 249-250 objects, why I dont know, but now you are aware. The solution for us was to "chop" our flat-file into several flatfiles containing only a "safe" number of records ..say 230-240 or so.

Hope you get some idea from this. Good luck!

regards,
claÜs

Shurbann Martes

Thursday 20 November 2003 4:23:55 am

Thank you Claus, I think you gave me enough ideas/tips to start this project.

Once in the while there would be a new entry in this DB. So it's not a "one-time-job". There are not alot of entries, so I wont be having the problem of timing-out I hope.

Next challenge is how to keep track of what have already been imported. (But I wont bother you guys with that :) )

Shurbann

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.