0

I'm using Delicious Brain's WP Migrate DB Pro plugin to migrate database tables and to transfer Media files (add-on) from my local virtual machine to my remote server (provided by GoDaddy)

This method worked fine up until a month ago and I've been trying to fix this hiccup ever since. The database tables migrate perfectly as before, but now when attempting to transfer the Media files from my Media library, I get this error:

Migration failed
JSON Decoding Failure — Our AJAX request was expecting JSON but we received something else. Often this is caused by your theme and/or plugins spitting out PHP errors. 
If you can edit the theme or plugins causing the errors, you should be able to fix them up, but if not, you can set WP_DEBUG to false in wp-config.php to disable errors from showing up. (#144)
    View error messages
    Unable to connect to the remote server, please check the connection details - 404 Not Found (#129 - scope: process_push_request)

Here is the identical server response that I get from the Network tab under the Google Dev Console:

{"wpmdb_error":1,"body":"Unable to connect to the remote server, please check the connection details - 404 Not Found (#129 - scope: process_push_request)"}

What changed recently is that my virtual machine had to go through an update, and then my local site had to be cloned. This caused a change in my .local URL, but I made sure to account for that in the migration process (with the find-and-replace step).

I've contacted tech support of WP Migrate DB Pro (Delicious Brains). They said something's up with the ModSecurity of my remote Linux server. Delicious Brains also said I could try whitelisting the .php file that is trying to get a server response from the remote server with some .htaccess file(s). The .php file they are referring to is called admin-ajax.php. Here's the code they recommended I insert:

<Files "admin-ajax.php">
SecFilterEngine Off
SecFilterScanPOST Off
</Files>

I then contacted GoDaddy's hosting support, and they said I can't edit ModSecurity on a shared hosting platform. Also, they haven't been too supportive of how to properly edit my .htaccess files.

So it seems my last shot is to whitelist the admin-ajax.php file, but I'm not sure how. When searching for .htaccess files on my remote server's file manager, these are the files that come up (I've included their respective code below their names):

/public_html/.htaccess ---

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

/public_html/wp-includes/.htaccess ---

<Files *.php>
deny from all
</Files>
<Files wp-tinymce.php>
allow from all
</Files>
<Files ms-files.php>
allow from all
</Files>

/public_html/wp-content/plugins/akismet/.htaccess ---

# Only allow direct access to specific Web-available files.

# Apache 2.2
<IfModule !mod_authz_core.c>
   Order Deny,Allow
      Deny from all
</IfModule>

# Apache 2.4
<IfModule mod_authz_core.c>
  Require all denied
</IfModule>

# Akismet CSS and JS
<FilesMatch "^(form\.js|akismet\.js|akismet\.css)$">
    <IfModule !mod_authz_core.c>
           Allow from all
  </IfModule>

 <IfModule mod_authz_core.c>
         Require all granted
   </IfModule>
</FilesMatch>

# Akismet images
<FilesMatch "^logo-full-2x\.png$">
        <IfModule !mod_authz_core.c>
               Allow from all
      </IfModule>

     <IfModule mod_authz_core.c>
             Require all granted
       </IfModule>
</FilesMatch>

/public_html/wp-content/uploads/wp-migrate-db/.htaccess ---

Options -Indexes
Deny from all

I've tried pasting Delicious Brain's recommended code in each one of these files one at a time. Nothing did the trick. In fact, Delicious Brains said I should paste the code in /public_html/.htaccess, but that rendered the WP Migrate DB Pro plugin unable to connect with the remote server from the main interface.

I'm running out of ideas, any insight would be extremely helpful :)

Thank you for reading.

  • Since this seems WP Migrate DB Pro specific, have you tried their official support channels? – kero Jun 17 at 6:49
  • @kero "I've contacted tech support of WP Migrate DB Pro (Delicious Brains). They said ...." – MrWhite Jun 17 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.