Import process freezes

This topic contains 13 replies, has 4 voices, and was last updated by  Kiran 8 years, 7 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #254015

    MLC Next S.L.
    Buyer
    Post count: 11

    Hello,

    I’m trying to import ~8000 locations from a csv file and when it hits record number 2081 it freezes.

    It’s not a frontend issue since I’ve left it a while when it freezed and then the locations imported are still those 2081.
    I’ve also tried partitioning the file into 2000 records per file, and still freezes at the same point (second file). But I don’t see any weird record that could raise up such a problem

    Any ideas?

    Thanks!

    #254121

    Guust
    Moderator
    Post count: 29970

    Really sounds like a problem with the data. Can you zip part of the file and attach here? You can make the reply private if you like.

    #254217

    MLC Next S.L.
    Buyer
    Post count: 11
    This reply has been marked as private.
    #254255

    MLC Next S.L.
    Buyer
    Post count: 11
    This reply has been marked as private.
    #254330

    Paolo
    Site Admin
    Post count: 31211

    Hi,

    the CSV file seems correct, I asked to the developers to check what’s wrong, but we really need a link and admin credentials to debug this.

    Quick question, is there any reason why you want to import that many locations in advance?

    Let us know,

    #254425

    MLC Next S.L.
    Buyer
    Post count: 11
    This reply has been marked as private.
    #254548

    Guust
    Moderator
    Post count: 29970

    I’ll leave the investigation for the developers, but adding to Paolo’s question as to why you are adding the locations, have a look at this: https://wpgeodirectory.com/docs/manage-location/#edit

    #255540

    Paolo
    Site Admin
    Post count: 31211

    The developers are looking into it. If you import at least 1 listing for each location, you don’t need to import the locations in advance.

    The locations will be created while importing the listings.

    We’ll let you know asap why it is freezing. I suspect it is a time out issue.

    Thanks for your patience,

    #255541

    MLC Next S.L.
    Buyer
    Post count: 11

    Hi!

    I don’t think it’s a timeout issue since dividing the file into smaller ones, it still fails in the same ranges of records. I tried diving by 2000 records each file, and it failed in the beginning of the second file.

    I’ve tried removing the chunks where it freezes, and it continues importing ok until it hits a new chunk of records where it doesn’t get past them unless I removed them. The funny thing is I’ve tried importing those removed records alone through a different file and they seem to pass without problem. Pretty weird…

    Although it is irrelevant to this error, I prefer to have a fixed locations list to avoid having to moderate each new listing that comes. I worked hard to get all my possible locations correct so it makes sense to take advantage of that.

    Let’s see if they can figure out what’s preventing the full import.

    Cheers!

    #255873

    Kiran
    Moderator
    Post count: 7069

    Hi Jacobo,

    I checked your attached csv and found that you have some duplicate location rows with same city + region + country name.
    Ex:
    41.74875 -4.301386 Moya Valladolid Spain
    41.60952 -4.796458 Moya Valladolid Spain

    So when saving the duplicate locations it looping with creating slug and stuck the import process. I have updated code to fix this looping.

    Please re-import locations and let us know.

    Thanks,
    Kiran

    #255882

    MLC Next S.L.
    Buyer
    Post count: 11

    Hello Kiran!

    And thank you very much for helping out. I can’t see those examples in my CSV files nor in the Excel that generates the CSV file (so I might be doing something very wrong!).

    What I do have is some cities that would get the same generated slug (I didn’t put those manually). For example:
    ,”28.1″,”-15.58333″,”Moya”,,”Las Palmas”,”Spain”,,,,,,
    ,”39.94834″,”-1.365402″,”Moya”,,”Cuenca”,”Spain”,,,,,,

    So the generated slug for that city would be “moya”, but with different region and same country. Would that be enough for the import process to fail?

    Besides that… Which code have you updated? It’d be interesting to know as I plan on using GD in another project-

    I tried reimporting the original CSV file and it went through OK! Thank sooo much!

    Regards,

    Jacobo

    #255897

    Kiran
    Moderator
    Post count: 7069

    Hello,
    Thanks for letting us know 🙂

    If city with slug “moya” already found in database and suppose you are going to add another city with name “Moya” and city_slug is column blank then it will use slug “moya-1”.
    You can also add city_slug in csv column to separate to city slug.
    Ex for cities:
    1) Cabanes Castellón Spain
    2) Cabanes Girona Spain
    You can also add region suffix to slug, so for 1 & 2 you can add city_slug “cabanes-castellon” & “cabanes-girona” respectively

    The updated code also will be included in the next version of Location Manager, so you don’t have to worry about loss of code during updating Location Manager plugin.
    If you still want code changes then you can find it between line nos 6192 – 6222 with function geodir_location_city_slug() in file pluginsgeodir_location_managergeodir_location_functions.php

    Hope you are clear now with city_slug.

    Thanks

    #255954

    MLC Next S.L.
    Buyer
    Post count: 11

    Hey!

    The thing is that I couldn’t find two cities with the same name in the same region, so I don’t get which “duplicates” could be causing trouble. I might have missed something, or maybe you had a look at it after some where imported and I tried reimporting without deleting them. I don’t know.

    Anyways, it works now. I won’t be on the other project for some weeks, so I guess the new version of Location Manager will be out by then 😉

    Thanks a lot for the quick fix! Cheers!

    #255961

    Kiran
    Moderator
    Post count: 7069

    Hello,

    After exporting locations and you are able to see duplicate cities in csv file if any there.
    If you want to update name or slug then just change name or slug and re-import that csv (Choose “Update item if item with location_id/city_slug already exists.” during re-import).

    Thanks

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount