WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Export for WP & WPMU
[resolved] how to export attachments only (2 posts)

  1. rcain
    Member
    Posted 2 years ago #

    whilst attempting to export a large site from from WP MU 2.7 to a new home on WP 3.3.1 i ran into problems with the export bombing out and the output file truncating/corrupting after approx 10MB.

    in addition, i only wanted posts - no categories, tags, or pages.

    thus i resolved to export in parts, by date.

    only problem, the exports were then missing any posts of type='attachment', thus i was left with no images to import to my new site.

    the solution i found: modify the plugin to produce ONLY attachments (as another valid post type from the admin drop-down).

    file: ra-export.php
    function: ra_export_page
    line: around 322

    change from:

    ...
    <select name="post_type" id="post_type">
    <option value="all" selected="selected"><?php _e('All Content'); ?></option>
    <option value="page"><?php _e('Pages'); ?></option>
    <option value="post"><?php _e('Posts'); ?></option>
    </select>
    ...

    change to:

    ...
    <select name="post_type" id="post_type">
    <option value="all" selected="selected"><?php _e('All Content'); ?></option>
    <option value="page"><?php _e('Pages'); ?></option>
    <option value="post"><?php _e('Posts'); ?></option>
    <?php /*mod jrc 300312 - allow attachments only*/ ?>
    <option value="attachment"><?php _e('Attachments'); ?></option>
    <?php /*end mod jrc 300312*/ ?>
    </select>
    ...

    simples. works a treat. (my only issue now is getting the 'wordpress-importer plugin (http://wordpress.org/extend/plugins/wordpress-importer/)
    - to import them reliably. hey ho.

    hope this helps someone.

    http://wordpress.org/extend/plugins/advanced-export-for-wp-wpmu/

  2. rcain
    Member
    Posted 2 years ago #

    PS. you can find my complete modified code here: http://pastebin.com/RVBQ7icG

    you may also be interested in this post concerning import of attachments (using plugin http://wordpress.org/extend/plugins/wordpress-importer/ ) here: http://wordpress.org/support/topic/plugin-wordpress-importer-not-importing-any-images-at-all (esp my notes concerning export/import of multiple batches).

    and my modified code for that plugin - here: http://pastebin.com/Xx7Sj7vN

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic