Forums / Developer / Importing data as object from another database

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

eZ debug

Timing: Jan 19 2025 00:17:23
Script start
Timing: Jan 19 2025 00:17:23
Module start 'content'
Timing: Jan 19 2025 00:17:23
Module end 'content'
Timing: Jan 19 2025 00:17:24
Script end

Main resources:

Total runtime0.3570 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0108 587.8438180.8125
Module start 'content' 0.01080.0071 768.656393.8203
Module end 'content' 0.01790.3390 862.4766523.1250
Script end 0.3569  1,385.6016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00511.4154200.0003
Check MTime0.00190.5385200.0001
Mysql Total
Database connection0.00090.254410.0009
Mysqli_queries0.288980.92721410.0020
Looping result0.00220.61061390.0000
Template Total0.338194.710.3381
Template load0.00190.529210.0019
Template processing0.336294.186710.3362
Override
Cache load0.00140.387410.0014
Sytem overhead
Fetch class attribute can translate value0.00130.366710.0013
XML
Image XML parsing0.00040.109310.0004
General
dbfile0.00631.7745200.0003
String conversion0.00000.003330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs