Migrating Custom Post Types from one site to another

Community Forums Forums Design Tips and Tricks Migrating Custom Post Types from one site to another

This topic is: not resolved

This topic contains 7 replies, has 3 voices, and was last updated by  Gary Jones 9 months, 1 week ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #86698

    Shari
    Member
    Post count: 5

    Hey there,

    I’m very new to all of this but I’ve been able to get my staging server set up and looking close(r) to what I want. I have just discovered that none of the custom post types are showing up however.

    I’m sure they’re in the db, but without them in the admin area, they don’t help me much. I am assuming I need to create a custom post type “clients” to match the existing CPT of the old site. I’m not sure exactly how to register the new post type so that I can use it, though.

    I saw some links to http://pippinsplugins.com/easy-content-types/ but I’m not entirely sure that will do what I’m looking to do and it seems like a bit overkill for what I’m trying to do here.

    I’m looking for the best way to do this or a pointer to where I can find this info.

    Thanks in advance!

    • This topic was modified 9 months, 1 week ago by  Shari. Reason: clarification
    • This topic was modified 9 months, 1 week ago by  Shari. Reason: clarification
    #86737

    nutsandbolts
    Keymaster
    Post count: 3176

    Hi, and welcome to the Genesis community! :)

    How were your custom post types created? Were they a plugin, something you coded in manually, or a part of your theme? That will affect the way you’ll want to deal with them.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #86765

    Gary Jones
    Moderator
    Post count: 693

    Yes, you’ll need to recreate the old CPTs in the new site. You could use a CPT plugin do this, like you’ve found, or a custom plugin that just registers your old CPT. They key bit is finding out under what post type the old posts were added as that is the only bit that needs to be the same.


    Changes in Genesis 2.1 – the ultimate guide to every single change in Genesis Framework 2.1, 2.1.1 and 2.1.2 (all 90 of them!) | @GaryJ

    #86796

    Shari
    Member
    Post count: 5

    Thanks you guys! :-)

    I think I got most of it worked out. I’ll share what I did, in case it may help someone else.

    I went back to the old site, assigned the CPTs I needed to a new user and was able to do an export/import that way. I used a plugin (CPT UI) to help me register the existing CPT name into the new site and now everything is showing up as it should.

    In retrospect, I probably did not need to do the import/export again, as the data was there, but I didn’t know that the name the old developer used was “wat-clients”. The first import failed and that’s how I discovered that.

    Now I just need to figure out how to fix the permalinks to be /clients/ instead of /wat-clients/ . Is it best to just register a new CPT “clients” and reassign them?

    Thanks again for your help.

    #86852

    Shari
    Member
    Post count: 5

    OK, so I tested it out. The permalink looks correct when I switch one post to my newly assigned “clients” CPT but then I get a 404 error. So that’s not going to be my answer. At least I don’t think so.

    There has to be a way to get the theme functions to recognize wat-clients as /clients/ now, right? I’m a little out of my league on this one still, so any insight would be helpful.

    #86870

    Gary Jones
    Moderator
    Post count: 693

    Does the CPT UI have a field for slug or rewrite? If so, that’s the one you want to change.

    If you’ve registered a new CPT, don’t forget to visit Settings->Permalinks to flush the rewrite rules, otherwise it will come up as 404.


    Changes in Genesis 2.1 – the ultimate guide to every single change in Genesis Framework 2.1, 2.1.1 and 2.1.2 (all 90 of them!) | @GaryJ

    #86875

    Shari
    Member
    Post count: 5

    Gary, that was it!

    I changed the slug (doh) and saved my permalinks and viola! Thank you so much!

    The thing that is unnerving about this plugin, though, is that whatever it does, does not stay if deactivated. That seems like a risky long-term solution to me. I’m really going to have to learn how to do this manually so that I’m not relying on this. This will work for me for today though and hopefully I can get this site live in the next few days.

    Thanks again.

    #86877

    Gary Jones
    Moderator
    Post count: 693

    I *think* the plugin allows you to export all the key registration parts, so you can create your own plugin that just does the registration.

    You can find generators that do similar on http://www.blazersix.com/wordpress-code-generators/ and http://generatewp.com/


    Changes in Genesis 2.1 – the ultimate guide to every single change in Genesis Framework 2.1, 2.1.1 and 2.1.2 (all 90 of them!) | @GaryJ

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

You must be logged in to reply to this topic.