Why Exporting with All-in-One WP Migration Sometimes Fails (and How to Fix It)

Why Exporting with All-in-One WP Migration Sometimes Fails (and How to Fix It)

Have you ever started an export with All-in-One WP Migration only to see it fail midway? One of the most common culprits is simply running out of disk space. Here’s why it happens and the lightweight add-on I built to fix it.

The problem: big files inflate your export

By default, All-in-One WP Migration bundles your entire WordPress installation, including everything in /wp-content/uploads/. If your media library contains heavy assets, the archive can grow beyond what your hosting plan (or temporary disk space) can handle, causing the export to fail.

Typical space hogs include:

  • Uncompressed audio like .wav, and audio like .mp3
  • Video such as .mp4, .mov
  • Archives and backups like .zip, .rar
Good news: Many of these files aren’t essential for a migration. You can exclude them to make the export smaller, faster, and far less likely to fail.

The solution: exclude specific file extensions during export

I created a small add-on for All-in-One WP Migration that lets you exclude file extensions from the export. You decide which types to skip—for example:

wav, mp3, mp4, zip

This instantly reduces archive size, speeds up the process, and prevents disk-space related failures.

How to use it

  1. Install and activate the add-on Media Type Excluder for AIWP Migration alongside All-in-One WP Migration.
  2. Go to All-in-One WP Migration → Export.
  3. Open Advanced options.
  4. Find Exclude file extensions and enter a comma-separated list, e.g. wav, mp3, mp4, zip.
  5. Run your export as usual.

The code behind the add-on

The plugin hooks into the export phase and, based on the extensions you provide, walks the uploads directory to build a list of files All-in-One WP Migration should skip. It also adds a small UI (a textarea) to the Export → Advanced options panel.

Full plugin code

defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
/**
 * Exclude extensions from All-in-One WP Migration export.
 *
 * This plugin uses the `ai1wm_exclude_media_from_export` filter to remove specific file extensions from the export process.
 * types from the exported archive.
 */
add_filter( 'ai1wm_exclude_media_from_export', function( $filters ) {
    if( ! isset( $_POST['ai1wm_no_extensions'] ) || empty( $_POST['ai1wm_no_extensions'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
        return $filters; // If the textarea is not set, return the original filters.
    }
    $upload_dir = wp_get_upload_dir();
    $base_dir   = trailingslashit( $upload_dir['basedir'] );
    $exts       = str_replace( '.', '', sanitize_textarea_field( wp_unslash( $_POST['ai1wm_no_extensions'] ) ) ); // phpcs:ignore WordPress.Security.NonceVerification
    $extensions = array_filter( array_map( 'trim', explode( ',', $exts ) ) );
    $extensions = apply_filters( 'eafaiowpm_exclude_extensions', $extensions );
    $iterator = new RecursiveIteratorIterator(
        new RecursiveDirectoryIterator( $base_dir, RecursiveDirectoryIterator::SKIP_DOTS )
    );
    foreach ( $iterator as $file ) {
        /** @var SplFileInfo $file */
        if ( $file->isFile() ) {
            $ext = strtolower( $file->getExtension() );
            if ( in_array( $ext, $extensions, true ) ) {
                $exclude_paths[] = $file->getPathname();
            }
        }
    }
    return $exclude_paths;
});

// Add textarea to Advanced Options
add_action( 'ai1wm_export_advanced_settings', function() {
    ?>
    <li>
        <label for="ai1wm-no-extensions">
            <?php esc_html_e( 'Exclude file extensions', 'media-type-excluder-for-aiowp-migration' ); ?>
            <textarea id="ai1wm-no-extensions" name="ai1wm_no_extensions" rows="4" style="width: 100%;"><?php echo esc_textarea( get_option( 'ai1wm_no_extensions', '' ) ); ?></textarea>
            <?php esc_html_e( 'Separate them by comma.', 'media-type-excluder-for-aiowp-migration' ); ?>
        </label>
    </li>
    <?php
});

Key points explained

  • add_filter( 'ai1wm_exclude_media_from_export', ... ) — taps into the export pipeline and lets us pass an array of file paths to exclude.
  • User input — a textarea in Advanced options collects a comma-separated list of extensions (e.g., wav, mp3). Dots are stripped for convenience.
  • Directory scan — a recursive iterator walks wp-content/uploads, comparing each file’s extension against your list and building $exclude_paths.
  • Result — those paths are returned to All-in-One WP Migration, which leaves them out of the export.
Tip for developers: You can pre-process or enforce a default set of extensions via apply_filters( 'eafaiowpm_exclude_extensions', $extensions ) in your theme or another plugin.

FAQ

What if I need those files later?

You can always run a second, media-only transfer or sync them via SFTP/SSH/CDN later. The goal here is to make the main site export succeed reliably.

Wrap-up

Export failures with All-in-One WP Migration frequently come down to disk space. By excluding heavy file types like .wav, .mp3, or .zip, your exports become smaller, faster, and far less error-prone.

Related articles

How to Safely Update a WordPress Plugin

To learn how to safely update a WordPress plugin, please read the detailed guide here:
How to Safely Update a WordPress Plugin

Related services

Help in case of issues after a plugin update

Want peace of mind when updating your plugins? Check out our Plugin Update Rescue – Annual Protection Plan
If something breaks after an update, we’ll step in and fix it.