CPT import error if not gd_place

This topic contains 11 replies, has 3 voices, and was last updated by  Nick Gardener 6 years ago.

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

Open Support Ticket
  • Author
    Posts
  • #453087

    Nick Gardener
    Expired Member
    Post count: 101

    I’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)

    #453089

    Nick Gardener
    Expired Member
    Post count: 101

    oops.. or not 🙂

    #453104

    Paolo
    Site Admin
    Post count: 31206

    Did 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

    #453105

    Nick Gardener
    Expired Member
    Post count: 101

    Oh 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?

    #453106

    Paolo
    Site Admin
    Post count: 31206

    TBH 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

    #453205

    Nick Gardener
    Expired Member
    Post count: 101

    I 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.

    #453241

    Paolo
    Site Admin
    Post count: 31206

    That’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…

    #453244

    Nick Gardener
    Expired Member
    Post count: 101

    Hopefully Stiofan can give us some good ideas!

    #453250

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    So 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

    #453254

    Nick Gardener
    Expired Member
    Post count: 101

    Yeah 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?

    #453488

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    1. how are your current non WP listings linked?

    #453498

    Nick Gardener
    Expired Member
    Post count: 101

    Really 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

Viewing 12 posts - 1 through 12 (of 12 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