pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 264 forks source link

Component: Convert Pod Type #434

Closed manastalukdar closed 6 years ago

manastalukdar commented 12 years ago

This is a feature request. Please support migration between (both to and from) Custom Post Type Pod and Advanced Content Type Pod. While migrating to custom post type Pod provide option of using default native WP table or separate table.

sc0ttkclark commented 12 years ago

Great idea, this was roadmapped but didn't have an issue added for it yet. I've added it, hopefully we can get to it in time for 2.1

estevanix commented 11 years ago

Hey, any news on this feature?

sc0ttkclark commented 11 years ago

It requires work to be done on #283 which handles migration of data that this will need. I'm anxious to get this done, but there are a few other things ahead of it unfortunately.

estevanix commented 11 years ago

Thanks scott! You guys are doing a fantastic work!

sc0ttkclark commented 11 years ago

We're looking for more contributors if you're interested in helping out anywhere. Anything not marked as 'in progress' is open to contributions.

ghost commented 11 years ago

Any updates on this feature? Or, does anyone know of a tutorial anywhere that could help me accomplish this manually? I created some pods in Pods 1.x, which have been upgraded to Pods 2.x and are now Advanced Content Types. I think I'd like to convert them to Custom Post Types without breaking the functionality of my custom Pods UI stuff, if possible, so that I can use the default WP search and have tighter integration with the rest of my site.

sc0ttkclark commented 11 years ago

I'd like to get this one going too, it would be fantastic to be able to convert Pods between types. And as I think more about it, this may need to really be combined with #283 as some times (like in the case of ACT > CPT) it can make more sense to do both a type and storage conversion at the same time.

I think if we can at least cover converting an Advanced Content Type into a Custom Post Type, that'd be a great first version of this component

forjoyilive commented 10 years ago

This would be a real help to us as well. Is there any way to contribute? I wouldn't trust myself with #283, but may be able to do lighter programming or testing.

sc0ttkclark commented 10 years ago

The main hold up on this and #283 are getting our '2.0 upgrade' script working to go through the content types being converted and move all of the data over to the new type (Post Type to Taxonomy, ACT to Post Type, etc). For #238, that's moving all of the Pod fields' meta over to the Table, or vice versa for Table to Meta convert. It's a tall order for anyone not already familiar with the upgrade script itself and how it works.

c0rnbread commented 10 years ago

Oh, this would be really cool.

basepack commented 10 years ago

Hey guys! Will this be implemented in Pods 2.4? That would be really awesome.

sc0ttkclark commented 10 years ago

Update: We're actively working on this new feature plugin for release alongside Pods 3.0 or potentially sooner.

forjoyilive commented 10 years ago

That's great, thanks for the update. By the way Scott, thanks for your contributions to WordPress core, I think I've seen your name in the comments on one of the Make blogs.

kenwiesner commented 10 years ago

Any updates on this? In desperate need for this functionality.

c0rnbread commented 10 years ago

You can loop through your existing pod and create entries in a new pod with the add() function.

sc0ttkclark commented 10 years ago

Technically, you can create a new Pod, name it something like "mypod2" and have it configured as the new content type you want it to be, then fetch through all the records and add them to it. Then, once done, delete the original "mypod" and rename the "mypod2" to "mypod".

Shelob9 commented 10 years ago

@c0rnbread Do you have an example function for this that you'd be willing to share? Could make a nice addition to our docs.

kenwiesner commented 10 years ago

@c0rnbread and @sc0ttkclark Thanks for the suggestion! I will give that a whirl. I don't know why I didn't think of that earlier. I was going to manually export the DB and import it using a plugin I have for importing CSV to CPTs but that would have been very messy. If I can come up with something intelligent I'll share. :)

sc0ttkclark commented 10 years ago

FYI the main hold up on this converter is an efficient method of doing these things DB-based, instead of using the API, with bulk inserts etc, instead of reading everything into memory via PHP and the slowdowns everything to do with that entail.

c0rnbread commented 10 years ago

@Shelob9 No example function, sorry. I was speaking of the same process as Scott.

manishie commented 10 years ago

Hi All, I have a CPT Pod with a huge number of fields in it, which now bogs down my server when I use it. I should have used ACT.

I can write a script to copy data from the old CPT to the new ACT as suggested above. But is there something I can do to convert the Pod definition from CPT to ACT? I've got a lot of fields in there and it would be a lot of manual work to recreate it. Thanks!

sc0ttkclark commented 10 years ago

You could use this to convert the Pod, but it won't create the table or migrate the content over for you: update_post_meta( $pod_id, 'type', 'pod' );

manishie commented 10 years ago

Oh that will save a lot of work. Thanks! I'll manually create the db table and migrate then content, but at least I won't have to setup all the fields in pods again.

Thanks.