How to rollback if a CSV import goes wrong?

Home Forums Calendar Products Events Calendar PRO How to rollback if a CSV import goes wrong?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #958002
    Chris Adams
    Participant

    Hi,
    I;m a fairly recent user of TEC(Pro) and have a client who is using Sharepoint & Outlook for their internal calendar. We’ve worked out how to export the data as a csv, how to change the format of the date to work with this plugin and all seems pretty straight forward when uploading… however I noticed an error in one of the csv file’s fields that meant the import skipped a tab and ended up really screwing with the data following that cell – so all following events imported were really skew-iff.
    So… my question is what is the best method to backup the data PRIOR to importing a csv that may update the current data, and if there was an issue (down the road) how is it best re-imported?
    In advance, thanks for your help.
    Chris

    #958245
    Brian
    Keymaster

    Hi,

    Sorry for the issues with the bad import. I can help you out.

    We do not have a rollback method. The easiest thing to do would be to delete all the events, venues, and organizers with the bulk delete in their respective lists.

    If you are looking for a backup of the site it would be a good idea to look for a plugin to do that on WordPress.org as we have no backup features.

    Let me know if you have any follow up questions.

    Thanks

    #959678
    Chris Adams
    Participant

    Thanks Brian,
    I’ve done that yes, and re-imported the data fine which is great (actually I have another issue but that’s on a separate thread!).
    So my query here evolves somewhat… As I understand the csv file import function to work, where there are already events in the system, if a csv file is imported and it includes both current events on the system and new ones it will leave the current events as they are, unless the new data is different, and it will add the new events to the system. Assuming all data is good to go, then no problem. But if the data uploaded has any conflicts or problems then the whole lot will need to be rolled back (and yes I understand that would need to be performed by a previously taken backup of the database).
    So – am I to assume that the best way to perform updates using csv import to prevent the possibility of having to rollback the whole of the database, would be for the set of data to include ALL events each time as opposed to updates to the current set of events? That way if there was a problem then it would be possible to (more) simply delete the lot and then re-import the last saved csv file that DID work, then bug check the new data before retrying…
    What are your thoughts?
    Thanks,
    Chris

    #959824
    Brian
    Keymaster

    The csv importer does not check for existing events. It is meant as a one time import not as a way to update existing events and add new ones.

    #959869
    Chris Adams
    Participant

    Hi Brian,
    I’ve just re-imported the file, having imported the same file previously and I get the following report:-

    Events Import (CSV)
    Import Result

    Import complete!

    Inserted: 56
    Updated: 25
    Skipped: 0

    The import statistics above have the following meaning:

    Inserted: A new item was inserted successfully.
    Updated: An item was found with the same name and/or start date. The existing item was updated with the new value from the file.
    Skipped: A row was found in the CSV file that could not be imported. Please see below for the invalid rows.

    Does this not mean that any entries found with the same start date and name are in fact updated by the new content?
    (BTW I am having issues with the original import, as it said it had imported a total of 81 events but ACTUALLY had only imported 50… another thread is open re this).

    #959950
    Brian
    Keymaster

    Oh my bad I was under the impression the importer was a one time deal and not used for updating or syncing existing events.

    Ok so I looked into the coding and the CSV importer tries to match events by title and Event Start Date and Event Date meta (this includes the date and time)

    So if the title and event times remain the same it will update the event. If not it will create a new event.

    #960740
    Chris Adams
    Participant

    Thanks for that Brian, going to run a few more tests to see how it goes – if I run into further issues then I’ll request further assistance.
    Before I go though(!) in your opinion, if the plugin was going to be updated ONLY by csv import, then does it make sense to keep a full csv of ALL events and upload afresh each time, keeping a backup csv of the last working import, in case there is any issue with the new data?
    Thanks,
    Chris

    #960756
    Brian
    Keymaster

    It is a little different to update WordPress by CSV so I am not sure I would go down that route. I would use it for imports of new content.

    I think it would be a good idea to upload only new events on their own csv and then add them to a master list each time as a backup.

    Cheers.

    #960759
    Chris Adams
    Participant

    Thanks Brian 🙂

    #960925
    Brian
    Keymaster

    Your Welcome.

    I am going to close this ticket, but if you need anything else related to this topic or another please post a new topic on the forum and we can help you out.

    Thanks

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘How to rollback if a CSV import goes wrong?’ is closed to new replies.