Merging two Custom Post Type Tables

This topic contains 3 replies, has 3 voices, and was last updated by  Russell 9 years, 2 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #30940

    Russell
    Expired Member
    Post count: 30

    Initially I thought it a good idea to separate my data into 2 exactly the same CPT.
    They have mirrored categories (slightly different names) and each has the same structure.

    However I now realise I need to have this in one single post type (the default places)

    I have tried exporting from phpmyadmin editing and re-importing into the default table but with no joy. Can anyone point me in the right direction to try and export the data from my custom post type into the default places post type??

    #30954

    Guust
    Moderator
    Post count: 29970

    The simplest I can think of is to export the obsolete CPT table and rework into a CSV file matching the standard upload CSV.
    Once you got your CSV file ready, make sure to delete all obsolete listings first completely using WP admin, then delete custom post type. If you leave any before re-importing you will end up with a lot of duplicate names and a “-1” will be appended to the slugs.

    I’ll alert Paolo too, he might have brighter ideas.

    #31058

    Paolo
    Site Admin
    Post count: 31206

    I would have suggested the same procedure as it’s the simplest at the moment….

    Thx

    #31583

    Russell
    Expired Member
    Post count: 30

    Interestingly enough I exported the obsolete cpt table from phpmyadmin as csv and made some edits to the rows using find and replace in open office. I also exported the default cpt and copied the data from the obsolete table to the default table to ensure all rows matched. I then imported it into the default cpt table back in phpmyadmin as csv. Did the same with the posts table and it seems to have imported ok with no errors.

    For anyone trying this then obviously do it on a backup copy of my database and site.

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

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

Open Support Ticket