ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Importing over 500 articles

July 08, 2007 4:12pm

Subscribe [6]
  • #1 / Jul 08, 2007 4:12pm

    lerva

    45 posts

    Hi,

    I need to import data from other database (mySQL). What is best way of doing that? Is it possible? If I’m correct, that entries have data in many tables, so it may be complicated.

    I can get my data out in csv - and I’m happy if I can get title, body and date to my EE database. There is other custom fields too - and it would be perfect to get them too. So can someone give me quick lesson about EE data structure? I’m sure many people have done this - but I couldn’t find much help from wiki or knowledge base.

    [moderator note: moved to how-to]

  • #2 / Jul 08, 2007 4:33pm

    Jason Morehead

    456 posts

    I would export your data into the Movable Type import format, and then import it into EE using the Movable Type Import utility.

    I’ve done this on several sites, with many entries.  It can be a little time-consuming, but it gets the job done.

  • #3 / Jul 08, 2007 4:37pm

    Ryan Irelan

    444 posts

    As far as learning the database schema for EE, I can only suggest you take a look at the tables and their relationships. There is a good bit of abstraction, but with a little time you can easily figure out how to import the data, if you would need to create a custom import script.

    I second what opuszine suggested and recommend you write a script to output your current data into the Movable Type Import Format and then import using the import tool that ships with EE. I’ve done it several times before - even with a site that had 20k entries (was very time consuming, as you can imagine) - so it’s achievable.

    Are you coming from another CMS? If so, which one? There might already be the script out there…

  • #4 / Jul 08, 2007 4:47pm

    lerva

    45 posts

    I used K2News - I googled and it seems to be still alive: http://studiov5.kreative-studios.com/index.php?Page=Site/Scripts/K2News

    Ok, I take a look of that Movable Type import format - it seems simplest way of doing this.

    Thanks for fast reply guys!

  • #5 / Jul 08, 2007 4:50pm

    lerva

    45 posts

    Quick question about that movable type… Is categories what I use when I want to decide which weblog entry should go?

  • #6 / Jul 09, 2007 5:02am

    lerva

    45 posts

    How you have made that Movable Type Import?

    I guess it’s best to make custom php script what takes data from database and puts it in that import format? This way I might get out without hand editing… or not 😊

  • #7 / Jul 09, 2007 11:09am

    WCW

    6 posts

    Another option, perhaps easier if you can get a clean csv file (ie no troublesome quotes or tabs or whatever delimiter you choose within entries) out of your database is the following plugin called csvgrab:
    http://www.brandnewbox.co.uk/logbook/article/csvgrab_expression_engine_plugin/

  • #8 / Jul 09, 2007 11:19am

    lerva

    45 posts

    Ah, that is probably just fine.

    As a newbie EE user I have to ask this - I use that plugin by first uploading my csv to server, then create custom template group like “import” where I have things like

    {exp:csvgrab url="http://www.url.co.uk/products.csv"<br /> weblog="5"<br /> title="1"<br /> skip="6"<br /> delimiter="TAB"<br /> encloser=""<br /> use="2|3"<br /> fields="prod_description|prod_keywords" }

    and then I go to http://www.mysite.com/index.php/import and magic happens? Or am I totally wrong?

  • #9 / Jul 09, 2007 4:14pm

    lerva

    45 posts

    That worked, BIG thanks WCW! I messed something with my encodings and special characters like ä,ö,å etc went broken. But MySQL UPDATE -> REPLACE made it easy to fix.

    Only thing that I have to update by hand is make review and band relationship work - I couldn’t import that because there wasn’t any relationship on my old site.

    Powerful, easy to use tool that CSVGrab. Just not very well documented.

  • #10 / Jul 10, 2007 8:04am

    Sue Crocker

    26054 posts

    CSVGrab is a great utility. That’s what I use for most migrations these days. I’m glad you were able to do your own import.

  • #11 / Jul 10, 2007 9:55am

    lerva

    45 posts

    I just found that EE even has find & replace - it makes much easier to replace those special characters.

    I think there should be well written guide in wiki about CSVGrab. I think it’s suitable for almost all kinds of imports.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases