Migrate Ads images in Classipress
Update: If you only need to export your ads to CSV/Excel, we recommend you to use this plugin:
Export Ads CSV
When you try to migrate all the content from one ClassiPress based website to another, there is a known problem that does not allow you to export/import the ads images. In a full content migration context with a lot Ads this could be a big problem because you must upload the images for every ad manually after migration done.
Here, we show a simple workaround to migrate all your content between two ClassPress sites, including all the ads images.
1. Go to your current CP site and select Tools>Export
2. Select to export All content:
3. Then, press ‘Download Export file’. This will generate an XML file
4. Now, we need to make a simple WP mod in our destination site to force WP to import all the attachments, to do that, we need to modify the file: wp-admin/includes/import.php adding only two lines of code:
// Save the data $id = wp_insert_attachment( $object, $file ); // BEGIN PATCH TO ALLOW IMPORT CLASSIPRESS ADS IMAGES $attach_data = wp_generate_attachment_metadata($id, $file); wp_update_attachment_metadata($id, $attach_data); // END PATCH
5. Finally, it’s time to import the content into our new site. To do that, we need to go into our destination site Tools>Import>.
[PLUGIN NEEDED] Okay, as far as i read here we all really need a classipress importer with images...
29/08/2012 @ 01:21
[…] want to migrate ads from anoher classipress site, you don't need a plugin, just read this post: http://classipro.com/migrate-ads-images-in-classipress/ If you want to import ads from other CMS, then you will need a thirdparty plugin. Regards […]
Adriano
07/11/2013 @ 21:59
It does not work. In that line of the code should be added exactly?
alucas
07/11/2013 @ 23:44
Hello Adriano
Take into account this mod was written for WP 3.4, not sure if it works with the latest versions
Peter
30/07/2015 @ 18:40
Hello Alucas,
Any idea why this patch does not work with the recent WP and CP versions?
Could you please update this code patch?
You would make me and a lot of other frustrated people very happy!
No problem for me to donate a few beers…
Thanks!
alucas
30/07/2015 @ 19:40
It’s supposed WP developers fixed this problem in recent versions.
alvaro_v_b
19/02/2019 @ 10:35
Hello, does this work with recent versions of Classipress? versions 3.6.x or v4.x?
alucas
21/03/2019 @ 14:08
It should, but not tested.