I am importing from one WordPress multisite instance to another, using Tools -> Export to generate a WXR file that I then import with and Tools -> Import . I receive the "Failed to import media" message for all files.

When I look at the apache log(on the production server, which is importing) I get:

[Wed Nov 13 11:05:30 2013] [error] [client] client denied by server configuration: /var/vhosts/wordpress/html/wp-content/uploads/sites/10, referer: http://drawyourweapons.wordpress.drake.edu/

The path on the test server I am importing from is: /var/vhosts/wordpress-test/html/wp-content/uploads/sites/10

The path to the new site on the production server is: /var/vhosts/wordpress/html/wp-content/uploads/sites/6

I do not understand why it is trying to get to that site on prod

  • Did you check the file permissions for the wp-content folder? Needs to be 755.
    – eskimo
    Commented Nov 13, 2013 at 21:25
  • yup, wp-content is set to 755
    – Purcell
    Commented Nov 13, 2013 at 21:58
  • Hmm. That's the only thing I can think of since it says denied by server. All the subfolders and files of wp-content are also set to 755? If so, someone with more expertise should look at this. Or you can manually move your media library, however that can be very frustrating as I know from recent experience :-). Can give you some tips though if you're going for a manual move.
    – eskimo
    Commented Nov 13, 2013 at 22:53
  • The error actually seems to be the server trying to write to a folder that doesn't exist. On the test server (exported from) the site ID was 10, on the production server (importing to) the site ID is 6. So I am really confused why the importer is trying write to a folder for a site ID that doesn't exist. the error log is from the production server, which is being imported to
    – Purcell
    Commented Nov 13, 2013 at 23:32
  • Please update your question with any new info, rather than posting it in comments. Also: Are you using WordPress's import & export functionality (ie WXR files), or are you trying to import from a SQL export or something?
    – Pat J
    Commented Nov 14, 2013 at 4:21

1 Answer 1


I've created a patch that will work around this issue. This patch is for WordPress 3.6.1. It is a hack, not something that should be taken very seriously except that it points out where the problem may be. I don't know PHP, but was able to trace it back to this point before giving up. I expect someone with more familiarity with the WordPress code base could figure out what the problem is once they see the patch and see what code is being modified.

I did notice that the code is doing a lot of checks against the IP of the remote server. I'm not sure the justification for checking whether the remote server is on a private network, but that may be part of the issue. The server we exported from is on, while the server we import on is Both are on the same private network.

The patch is available here: http://pastebin.com/LeVtWKhX

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.