Moving posts between CPT
This topic contains 6 replies, has 3 voices, and was last updated by Alex Rollin 6 years, 9 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
December 12, 2019 at 3:49 pm #521189
Hi,
I want to move all posts from one CPT to another. Tried this:
https://wpgeodirectory.com/docs/core-export/#tips
(left ID unchanged, updated post_type, default_category, package_id and post_category according to packages and categories on target CPT)
Categories show correctly on backend list, but not when I edit the posts (empty), location gets lost and the import is getting stuck in the middle.
I checked the database and even those posts which appear on the backend as in the new CPT remain in the previous SQL table.
Re-importing (deleting the IDs) seems to work, but then I will lose the relationships for translations and franchise.
How about copying the data on SQL directly? What is the risk and which tables should I touch?
Can you please help?
December 12, 2019 at 4:05 pm #521201Yes, ID must be removed, and there isn’t a way around it. We do not provide support for direct-to-database imports.
If the linked posts are linking TO the one you are moving, then yes they would need to be created, along with the franchise links.
December 12, 2019 at 4:10 pm #521207Then it seems the documentation is wrong:
https://wpgeodirectory.com/docs/core-export/#tipsJust to be clear, please confirm if this is what I should do:
1. Delete translations (to avoid duplication of posts)
2. Import listings (without ID, updated categories to new CPT)
3. Create franchising links
4. Translate (WPML)Seems like a very fragile process…
December 13, 2019 at 6:30 am #521296Hi adminparentland-pt,
All CPTs has different database table to store data apart from wp_posts table.
For example:
– gd_place posts data saved in wp_geodir_gd_place_detail table.
– gd_event posts data saved in wp_geodir_gd_event_detail table.
– gd_hotel posts data saved in wp_geodir_gd_hotel_detail table.If you want to move all gd_place posts to under gd_hotel then you have also move data from wp_geodir_gd_place_detail to wp_geodir_gd_hotel_detail. Make sure both CPTs has same fields in table.
Most easy way to move posts from one CPT to another CPT is export/re-import.
– Export posts from CPT which want to move
– Edit CSV file
— Make blank post_id
— Change post_type
— Set correct default_category & post_category of the new CPT
– Re-importRegards,
KiranDecember 13, 2019 at 6:44 am #521298Hi adminparentland-pt,
We have fixed issue of importing and linking translated listings to original listing. It will be in next release of GeoDirectory Multilingual plugin.
– Download and upload development version from https://github.com/AyeCode/geodir-multilingual
– Follow instructions given here https://wpgeodirectory.com/support/topic/imported-languages-via-csv-are-not-automatically-linked-to-original-language/#post-512633Let us know.
Kiran
December 16, 2019 at 5:20 pm #521748Hi,
I suppose I need to delete the post_id first of all. If so, how is the wpml_translation_of column suppose to know to which post_id to relate to?
Should I first import the original language (in order to create the new IDs) and then (somehow) lookup the translation to fill-in the wpml_translation_of column?
Please help!
Thanks
December 16, 2019 at 11:45 pm #521830Yes
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket