WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] [closed] Bulk CSV Import (Mass Upload) (43 posts)

  1. ehong33234
    Member
    Posted 1 year ago #

    After looking around and not being able to find a Bulk CSV Importer for the wonderful Events Manager wordpress plugin, I commissioned a coder to develop a Bulk CSV Import add-on that does not modify any core code files (so you can update wordpress and plugins freely). It is a very simple integration and clean and I tested it on my own site many times. The plugin saved me HOURS of manual entry time and cost when having to add hundreds of events to my site.

    Just trying to recoup my costs so grab it if it is what you are looking for.

    http://csvbulkimport.wordpress.com/

    http://wordpress.org/extend/plugins/events-manager/

  2. angelo
    NetWebLogic Support
    Posted 1 year ago #

    thanks for sharing.

  3. cocopops67
    Member
    Posted 1 year ago #

    Hi, the page doesnt exist or no link can be found for this? I have waited with baited breath for an importer - so much so I actually moved from events manager to tablepress just so I could import items in bulk. This would be a great addition (again)

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    shame that went down, but there's two others for anyone interested:

    https://github.com/soixantecircuits/wp-events-manager-importer
    http://em.cm/importer-exporter

  5. Marketing Master
    Member
    Posted 11 months ago #

    Can you attach some example of CSV file?

    Thx, BR

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 11 months ago #

    I haven't had time to test these so i have no samples to share

  7. steve098
    Member
    Posted 11 months ago #

    for http://em.cm/importer-exporter

    an example csv is here
    http://pastebin.com/TaEB9GBQ
    note that the column locations are not important (I think) as the importer converts the data to a named array; it is the name of the column headings (the first row) that are crucial and must match that as defined in the class.EM_ImpExpImport.php file.

    there is a small fix to the file
    /wp-content/plugins/events-manager-import-export-0.0.3-alpha/class.EM_ImpExpImport.php in order that it will read your event start/end date+time. Line 480 onwards - see commented out sections in the below code- previously it was hardcoded to start each event at midnight.

    http://pastebin.com/SCd33zCT

    Note also that the end three columns are custom event attributes defined within our Events Manager instance, and the headers should match EXACTLY the event attributes you define in E.M.

    Note also that you can define multiple categories for a single event by enclosing them in double quotes, comma separated within the quotes. Excel's .CSV MSDOS format copes with this well, despite my initial reservations that the additional comma inside the quotes would break the import; it did not.

    Note also that I have pre-defined the location within Events Manager, then instead of risking having the importer create extra location entries via geocoding, I simply give it the exact name of a pre-existing location and the import routine matches this for you.
    i.e. I have not tested uploading an event at an unknown location

    this worked for me: I am a php and Events Manager novice. be warned.

    (thankyou to Marcus and the author of the importer (WebAware.com.au) for your wonderful software)

  8. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 11 months ago #

    @steve098 thank you for sharing your findings. i will likely point people here now so they see all the options :)

  9. thatsgame1
    Member
    Posted 11 months ago #

    I'm giving it a try:

    I've replaced the php code and setup a .csv file with columns to match steve098.

    When I import an event with dtstart of 07/31/2013 11:00:00 and dtendof 07/31/2013 11:45:00. The actual date that is shows on the event itself is 07/07/2015 11:00:00 and 07/07/2015 11:45:00.

    I've created the csv file in Excel and tried messing with formatting the cell as text and date.

  10. steve098
    Member
    Posted 11 months ago #

    can you post the first two lines of your csv to pastebin so we can have a look at your header and a sample post?
    (please open your csv in Notepad or similar, not Excel)

    my suspicions lie with the date format being spewed out from Excel.
    I have this set to a custom number format in Excel

    dd/mm/yyyy hh:mm:ss

    My limited PHP knowledge tells me that the import is looking for a dtstart/dtend in the format d/m/Y H:i:s (lines 483 and 489 of Class.EM_ImpExpImport.php) see php date formats
    yours is perhaps producing a csv with m/d/Y?

  11. thatsgame1
    Member
    Posted 11 months ago #

  12. steve098
    Member
    Posted 11 months ago #

    The dtstart and dtend are indeed in m/d/Y in your csv. You could try either switching the importer code over to m/d/Y or just adjusting your csv to match d/m/Y

    your csv is tab delimited. (csv stands for Comma Separated Values!)my interpretation of the importer code is that it should be able to handle tab delimiters (the csv import library dynamically detects the delimiter), but is not a scenario I have tested. Play it safe and stick with commas? If you have commas in your event, this appears to be ok, so long as the field is surrounded by double quotes (as per the 'categories' field in my example CSV

    You mention you are producing your CSV from Excel, and this is probably the cause of your headaches:
    try my suggestions above, which are
    1) format the dtstart and dtend cells in Excel to be custom number format dd/mm/yyyy hh:mm:ss
    1) export from excel in .csv (MS-DOS) format

    make sure to examine your output csv file in Notepad or other text editor to check for proper formatting.

  13. jhetrick62
    Member
    Posted 11 months ago #

    I do appreciate the work of Steve as well as Marcus for pointing us to the importer. It does work well, except that I can't get the dates to work myself. If I put in the fix that Steve suggested, I get a class error and that is throwing me off. I get the code that he put in and it appears correct, but doesn't work for me for some reason.

    I did output my file to Textwrangler on my Mac to verify and it is formatted properly,
    ,07/08/2013 16:00:00,07/08/2013 18:00:00,
    That is the dtstart and dtend portion of my file in the line above. Here is the error I get, which I'm not sure as to why:

    >> Error
    Call to undefined function date_create_from_format() in /home4/jhetrick/public_html/demo-mm/wp-content/plugins/events-manager-import-export-0.0.3-alpha/class.EM_ImpExpImport.php on line 483
    << End of error

    Seems to be a php error code and I'm not that good with this stuff. Maybe with an hour or so on Google I can figure it out, but I'm running fully updated WP. I can check my host for PHP and MySql versions.

    Any thoughts?

  14. steve098
    Member
    Posted 11 months ago #

    99% sure it's your PHP version on your host. One of the date functions called in create_from_format requires 5.3 minimum I think. I forget the exact version requirements and functions.
    what's your PHP version?

  15. jhetrick62
    Member
    Posted 11 months ago #

    I do appreciate the work of Steve as well as Marcus for pointing us to the importer. It does work well, except that I can't get the dates to work myself. If I put in the fix that Steve suggested, I get a class error and that is throwing me off. I get the code that he put in and it appears correct, but doesn't work for me for some reason.

    I did output my file to Textwrangler on my Mac to verify and it is formatted properly,
    ,07/08/2013 16:00:00,07/08/2013 18:00:00,
    That is the dtstart and dtend portion of my file in the line above. Here is the error I get, which I'm not sure as to why:

    >> Error
    Call to undefined function date_create_from_format() in /home4/jhetrick/public_html/demo-mm/wp-content/plugins/events-manager-import-export-0.0.3-alpha/class.EM_ImpExpImport.php on line 483
    << End of error

    Seems to be a php error code and I'm not that good with this stuff. Maybe with an hour or so on Google I can figure it out, but I'm running fully updated WP. I can check my host for PHP and MySql versions.

    Any thoughts?

  16. jhetrick62
    Member
    Posted 11 months ago #

    Sorry, about the double post! My mistake. I will look that up now.

  17. jhetrick62
    Member
    Posted 11 months ago #

    You are correct! 5.2.17 on PHP! I will have to find the code for the earlier version I guess? I doubt that it can be upgraded as this is a shared host, not a VPS at this point.

  18. jhetrick62
    Member
    Posted 11 months ago #

    Ok, you were correct and I have it fixed! For all Hostgator accounts and possibly many of the other entities that the conglomerate that owns them also owns, you have to put a code snippet into your .htaccess file on a Linux Shared host. It enables the PHP 5.3 code in each domain. You would have to add it for each domain if you needed it in more than 1 of course. There are other help notes for Windows Shared or VPS hosting, this one is Linux Shared specific if your host is not running 5.3. Newer builds will be running 5.3.

    Here is the code so that you don't have to do the research.

    # Use PHP 5.3
    AddType application/x-httpd-php53 .php

    Thanks to Steve098 for his re-engineered code to make the date import work and hopefully this post saves someone else 2 hours of playing with their dates in frustration as I did last night.

  19. steve098
    Member
    Posted 11 months ago #

    Glad it works for you - thanks should go to the plugin author webaware.com.au - although I can't find a link to the import/export plugin on their website - only the shorturl above.
    It would be great if the plugin was published on a repository somewhere (It's GPLv2?), in case the short url dies,and so it can be taken forward in functionality, but I wouldn't know where to start with checking licenses or uploading to a repository ( I see the code is still alpha).

  20. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 11 months ago #

    the short url won't die, it's ours ;)

    like EM, the plugin has to be GPL compatible

    for now it won't be published as a plugin. it may go up as a seperate plugin but as we are intending on adding importers at some point too it may not

  21. thatsgame1
    Member
    Posted 11 months ago #

    Seems to be working!. Thank you everyone. Can't wait for this to be a part or an add-on to the plugin.

  22. gabrielstuff
    Member
    Posted 11 months ago #

    Hey,
    We just update a bit : EMI (Events Manager Importer)

    We add examples files in folder examples and we add CSV support for those who wanted it. thanks to Meitar

    Also, we clean a bit the code in order to avoid warning and breaking the RSS feed as one of user told us.

    We also remove specific folder upload, add drag and drop support for CSV and XLSX. Finnally we clean the code to remove some ajax depencies and rely on wp-ajax straightforward method.

    Hop it will help some of you.

    You can ask for features here :
    https://github.com/soixantecircuits/wp-events-manager-importer/issues

    Thanks !

  23. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 11 months ago #

    @gabrielstuff nice!

  24. Marketing Master
    Member
    Posted 11 months ago #

    gabrielstuff I’m trying to import your sample (export_LIGHT.xlsx). It works, but only of name of event, date and location. But I can’t import content – description. Imported description is always showing as three dots (…).
    I'm also interesting how to specific other values in XLSX file for proper import. For instance for other placeholders and custom attributes. Is there important first name in the column or there is only a sequence and how I can determinate right order in XLSX file?

    Importer is awesome and you are doing great job.
    Thx, BR

  25. jhetrick62
    Member
    Posted 11 months ago #

    Marketing,

    I haven't looked at this export_LIGHT.xlsx file yet, but in general, it depends on how your excel file exports to a .csv file for importing. Have you opened your file in a clear text editor such as Wordpad or Notepad, or even better yet a linux editor to see if it truly meets the criteria?

    I find that working in OpenOffice which is free, is highly better than working in Excel when manipulating the export of spreadsheet files to .csv file.

  26. gabrielstuff
    Member
    Posted 11 months ago #

    @Marketing Master what is this sample, could you link to it.... not sure it is a good files :)

    Also, as for now order is necessary. This should be fixed with the mapping tool allowing to decide which column goes with which field.

    I'll test later today you issue. In the mean time do not hesitate to open it on github.

  27. Marketing Master
    Member
    Posted 11 months ago #

    @jhetrick62
    Importer now support .xlsx and I didn't make any transform to .cvs.

    @gabrielstuff
    I download sample from this link. I didn't found any example folder that you mentioned in wp-events-manager-importer-master. Can you explain me about mapping tool - where can I found it and how I can use it?

    Thx, BR

  28. thatsgame1
    Member
    Posted 10 months ago #

    Hi again everyone. I guess I spoke to soon again about it working. It DID work when I tested a single event but now I'm actually attempting to import for real and running into problems with the date and time not working on the event.

    Test import file: http://pastebin.com/S73MSTFX

    I've made sure:

    • Saved as MS-Dos CSV
    • Looked at the doc in notepad to check it looks ok
    • Verified dates are dd/mm/yyy hh:mm:ss
  29. thatsgame1
    Member
    Posted 10 months ago #

    Forgot to mention I'm still using: http://em.cm/importer-exporter

    I'd like to try: EMI (Events Manager Importer) but I don't know how I would determine what the header fields would be in he .xlsx. I've looked at the https://github.com/soixantecircuits/wp-events-manager-importer/commit/1ce68093ecf566ebeb49060eca9e763e5279f866 but don't understand how there is just a "date" field and no dtstart and dtstart fields. And also don't get the other fields, Libellé Segment CP-Ville (unless those are custom fields).

    At minimum I'd like to import title, start date, description. Bonus would be end date.

    Thank you for any help you can provide. I've got a couple thousand events I need to import for a website go-live on the 1st of September.

  30. Marketing Master
    Member
    Posted 10 months ago #

    Hi
    Is there any new solution?
    Thx,BR

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic