Community Forums › Forums › Archived Forums › Design Tips and Tricks › Migrating Custom Post Types from one site to another
Tagged: CPT, Custom Post Type
- This topic has 7 replies, 3 voices, and was last updated 10 years, 10 months ago by Gary Jones.
-
AuthorPosts
-
January 23, 2014 at 4:01 pm #86698ShariMember
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!
January 23, 2014 at 8:36 pm #86737nutsandboltsMemberHi, 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/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+January 24, 2014 at 3:03 am #86765Gary JonesMemberYes, 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.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
January 24, 2014 at 7:38 am #86796ShariMemberThanks 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.
January 24, 2014 at 11:41 am #86852ShariMemberOK, 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.
January 24, 2014 at 2:02 pm #86870Gary JonesMemberDoes 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.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
January 24, 2014 at 2:25 pm #86875ShariMemberGary, 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.
January 24, 2014 at 2:34 pm #86877Gary JonesMemberI *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/
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.