Hi @dbareis
Pods doesn’t include an import tool for posts and other content, only for configurations.
I might want to take a look at plugins like WP All Import.
Alternatively there are many database app’s that support import from CSV. A free example would be DBeaver.
Cheers, Jory
Also, if comfortable writing an importer with PHP, see:
Thanks, I’ll look at this when I’ve got PODS itself working as I want it… But it does seem like it wouldn’t be hard to integrate this into pods… I would want to import export just the pods data nothing else.
@keraweb @pdclark Thanks for your responses, I’m trying existing tool for import, creating the CSV by code (nothing to export).
What I’m doing is trying to convert a static set of 170 pages into dynamic ones with pods, so I’m exporting (with “WP ALL EXPORT/IMPORT“) just so I can see the format I need to recreate to be able to import it.
I’ve worked out most of the data gathering so now I’m looking at the CSV I need to create for import.
Lets say I have a PODS field I created called “plant_main_image” which contains an image I selected. Do I import “plant_main_image” which is a serialised object by the look of things, or “_pods_plant_main_image” which is a serialised array containing the image’s ID (which I have)? Or even worse both? The images are already in the database and I have created taxonomises etc, I just want to create the “Plant” pod and link things…
There are other similar fields where there are pods and other versions.
Hi @dbareis
Sorry for my late reply, hopefully you’ve already sorted it out.
I would assume WP All Import is using the WordPress functions for updating metadata. If this is the case then Pods would hook into the update filters and applies the relationships as it would when saving a regular post.
Cheers, Jory
@keraweb
Thanks, I decided it was easier to write my own import-export code. That is working well apart from the fact that while my PODS support revisions (in “supports” section, they don’t seem to support revisions. Only If I manually add a plant does it support revisions (and then only new plants). That is the attribute only seems to apply at the time of a manual creation.
Hi @dbareis
Did some digging and it appears that WordPress doesn’t hook into wp_update_post or wp_insert_post at all.
The only function that includes creating revisions is edit_post: https://developer.ww.wp.xz.cn/reference/functions/edit_post/
This function only gets triggers when saving the post from the WP admin interface and handles revisions prior to calling wp_update_post.
Cheers, Jory