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 TicketTagged: import multilocation
-
AuthorPosts
-
August 26, 2016 at 6:32 pm #254015
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 problemAny ideas?
Thanks!
August 27, 2016 at 1:45 am #254121Really 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.
August 27, 2016 at 10:11 am #254217This reply has been marked as private.August 27, 2016 at 11:15 am #254255This reply has been marked as private.August 27, 2016 at 3:17 pm #254330Hi,
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,
August 27, 2016 at 5:15 pm #254425This reply has been marked as private.August 28, 2016 at 12:06 am #254548I’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
August 29, 2016 at 3:31 pm #255540The 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,
August 29, 2016 at 3:37 pm #255541Hi!
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!
August 30, 2016 at 8:03 am #255873Hi 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 SpainSo 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,
KiranAugust 30, 2016 at 9:20 am #255882Hello 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
August 30, 2016 at 10:02 am #255897Hello,
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” respectivelyThe 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.phpHope you are clear now with city_slug.
Thanks
August 30, 2016 at 10:51 am #255954Hey!
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!
August 30, 2016 at 11:16 am #255961Hello,
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
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket