csv data import logic

This topic contains 5 replies, has 3 voices, and was last updated by  Alex Rollin 4 years, 5 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #515832

    info@supamoov.com
    Expired Member
    Post count: 47

    Hi
    When my directory first goes live, it will rely on a bulk import to populate the database. This will be refreshed a number of times. I need some logic to delete listings that no longer appear in the data feed. Something like this:
    Start
    flag all records for a region as “old”
    import all data for a region; if new or updated, flag records as “new”
    delete all records for the region that are still flagged as “old”
    End
    Is this possible using either the supplied csv importer or the WP AllImport plugin provided?
    Can you offer guidance on how to accomplish this?

    #515850

    Guust
    Moderator
    Post count: 29970

    If I understand you correctly, the closest I can suggest is:

    1. Export the listings
    2. Add any new listings to the CSV file – do NOT add a post ID
    3. Change the “post_date” for any updated listing to today’s date
    4. Change the “post_status” to draft for any listings you want to delete
    5. Import after selecting “Update listing if post ID already exists.”
    6. Delete all draft listings

    Thanks

    #515862

    info@supamoov.com
    Expired Member
    Post count: 47

    Thanks for the prompt response Guust. The data volumes are going to be in the tens of thousands so I need to make it as automated as possible, and avoid an export if I can. However, your comments around “post ID” suggest that it’s the primary key for the listing and is used by the csv import system for record matching on the import, where as I would need to define the key myself to follow the logic I outlined in the original question.

    An alternative approach would to be create a “feed ID” and then:
    Start
    Delete all records where feed ID = X and region = Y
    import feed data as new records for region = Y, and feed ID X
    End.

    That’s less efficient,but would work. Is that possible?

    #515877

    Alex Rollin
    Moderator
    Post count: 27815

    No, that is not possible with GD Features.

    Bulk delete is accomplished through the backend, up to 200 listings at a time.

    https://wpgeodirectory.com/docs-v2/faq/troubleshooting/#delete

    #515879

    info@supamoov.com
    Expired Member
    Post count: 47

    Thanks Alex,
    I’m pretty sure WP AllImport advertises a “delete missing records” feature. I’ll take a look at that to see if it works with GD.

    Although my request is a bit extreme for the initial database load (I’m doing that from a portal, hence the large volume of records), later I’ll be processing smaller datafeeds provided by individual estate agents’ CRM systems, so I’ll need to find some way to automate that. When I get to that point I will contact you for help with the database structure so I can do it through custom code.

    #515885

    Alex Rollin
    Moderator
    Post count: 27815

    You can try our WP All Import integration, certainly.

    https://wpgeodirectory.com/downloads/wp-all-import/

    If you need custom development you can find experts familiar with our code here:

    https://geodirectoryexperts.com/

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket