Scope: Prime Mover Free

Background

This issue only affects users of Prime Mover Free in Windows operating systems. This is due to the fact that Windows limits the number of characters in the path with a constant known as MAX_PATH limit.

You will get this error if the website under migration has some very long file paths. Usually you will get this if you have a plugin with git folders or vendor folders which is deep nested. This results to very long file paths.

Related Errors

Using Prime Mover plugin, the following are the associated runtime errors caused by this issue:

  • Main extraction failed (No error)

Windows OS Workaround

  • Check first if you already configured Windows to accept file paths over 260 characters. If you are not sure, try this regedit fix by this tutorial.
  • Do not proceed below unless you have done above.

Temporary Plugin Workaround

If you have done above, the next thing would be apply a temporary plugin workaround.

  • In your Windows OS, go to C:\ root drive and create folder named as pm_tmp
  • Open your favorite code editor and copy the code below :
<?php
/**
Plugin Name: Prime Mover Windows MAX Path Limit Error Workaround
Plugin URI: https://codexonics.com
Author: Codexonics
Version: 1.0.0
Author URI: https://codexonics.com
*/

add_filter( 'prime_mover_filter_basebackup_dir', function( $path ) {

//This will create and use C:\pm_tmp as the temporary backup tmp
return 'C:\pm_tmp';

});
  • Save this code as prime-mover-max-path-workaround.php
  • The above code will use C:\pm_tmp as your new Prime Mover export directory which is actually a shorter path than the default.
  • In your /wp-content/ directory, create a folder named as mu-plugins (if it is not yet created)
  • Copy the above plugin code to this directory. Make sure to place it inside the mu-plugins directory. The resulting path to this script should be /wp-content/mu-plugins/prime-mover-max-path-workaround.php
  • Activate Prime Mover plugin.
  • That’s it, you can now proceed to export / import using Prime Mover Free version. You should not be getting errors anymore.

Permanent Fix

The above plugin is just a workaround for Windows MAX Path limit error. The recommended permanent solution would be to use the PRO version which allows you set a custom base backup directory directly inside Prime Mover.

It looks something like this (temporary plugin is no longer needed and should be deactivated)

As you can see, the custom backup directory is permanently set to use C:\pm_tmp. Since the directory is placed on the Drive C root directory, the paths will shorten.

If you still see errors after doing this fix (permanent or the workaround), then the issue is in your site paths. It might be too long that its affecting portability between operating systems.

IMPORTANT: Please remove the temporary script prime-mover-max-path-workaround.php in the /wp-content/mu-plugins/ after you have upgraded to Prime Mover Pro version. It is not anymore needed since you can set the custom export directory path in the plugin settings.

Was this article helpful?
YesNo