CPT import error if not gd_place
This topic contains 11 replies, has 3 voices, and was last updated by  Nick Gardener 6 years, 11 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket- 
		AuthorPosts
- 
		
			
				
November 8, 2018 at 4:50 pm #453087I’ve just tried importing a a different CPT (not places) and whilst it says that 55/55 rows imported successfully, they’re neither on the site nor in the db… :/ (will attach file to next private post) November 8, 2018 at 4:50 pm #453089oops.. or not 🙂 November 8, 2018 at 6:03 pm #453104Did you import them for the 1st time with an ID? If yes, that’s the mistake. The ID field must be created by the application and you can only use it to update listings. If this doesn’t help, please provide a link and admin credentials in a private reply and we’ll check. It’d be great if you could provide FTP credentials too so that we can check debug logs. Thanks November 8, 2018 at 6:11 pm #453105Oh that’s interesting. Right. So.. hmm. So here’s my situation: I’m importing linked data from a custom app. The relationships exist as IDs in columns, so it’s relationally structured. But I need to work out how to bring that data across. An automatic solution is necessary, alas: there are some 35000 records across 4 different CPTs. Any cunning ideas? November 8, 2018 at 6:15 pm #453106TBH I don’t know. I’ve asked to Stiofan to check your question and let us know. Please be patient because he’s off for the day and he’ll be back online tomorrow morning UK time. Thanks November 9, 2018 at 10:32 am #453205I tried a work around, which possibly highlights a bug. Experiment theory: if I import id, title, type directly into wp_posts in sql, and THEN run an import with Update by ID, then it will import the full data. Practise: 
 – even though Update by ID was selected, it just created 3 new rows.November 9, 2018 at 2:30 pm #453241That’s not a bug, we don’t write in wp_posts only, you’d need to create records in the geodir_gd_cpt_details table too and I’m not sure it would work either… November 9, 2018 at 2:52 pm #453244Hopefully Stiofan can give us some good ideas! November 9, 2018 at 3:12 pm #453250So your importing listings from a non WP DB? Whats the schema of your DB like? My initial thoughts are u would need to create new fields like “old_id” and “old_link_ids” and then after its all imported as normal u would run a script to re-link referencing the old id’s Stiofan November 9, 2018 at 3:20 pm #453254Yeah we tried that before — it turned out to be fiendishly complicated and lots of trouble. Lots of cells are involved, it seems. Is there a way in which we can directly import part of the data into one sql table, and have it update the rest from import? Perhaps including a re-export to get the fresh ID? November 10, 2018 at 4:21 pm #4534881. how are your current non WP listings linked? November 10, 2018 at 5:00 pm #453498Really badly. We tried an import direct to sql and basically it didn’t work as well as it should because we missed fields. I was hoping to start over and take the data we have a CSV and import it. In the csv the data is linked id comma separated values in one cell, referencing the ID of the linked item, ie. ID | Title | type | linked 
 1 | oneone | gd_place |
 2 | twotwo | gd_place |
 3 | threet | gd_bblog | 1
 4 | fourfo | gd_bblog | 7
 5 | fivefi | gd_bblog | 2
 6 | sixsix | gd_event | 5,2
 7 | sevens | gd_event | 2
 8 | eighte | gd_event | 1
 9 | nineni | gd_event | 1
- 
		AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket