Media import to Staging Site takes too long, then throws a 502 Bad Gateway error.

Hello all,

We just recently decided to roll out a staging site after doing all our changes through production… bad, I know. Regardless, now that we have the staging site the next part is to import all the data from the prod., to the staging.

Using the wordpress importer, I have successfully been able to export from prod. and then import into staging all the Page and Product xml data, but for some reason I am unable to import the media onto the staging site. Once I submit the import, the tab loads for about 1 minute which is normal but then throws me a white screen with a generic “502 Bad Gateway” page.

So what gives? Why does the importer dislike my Media xml?

There is no way that it could be a file size issue, as the Media xml is a mere 2.6mb and for reference the Page xml is 12mb, which imported fast and successfully.

The only thing I can possibly think of is that the Media library of the prod. site consists of, of course, images but also contains some pdfs and a zip file. Maybe the importer only likes image types?

I suppose I could always just download the images to a flashdrive and add them as I need them? Or offload the other non-image filetypes and try an xml of purely images?

1 Comment
  1. You are embarking on a workflow that is a giant shit pile. If your hosting provides staging then use that. If not then start a subdomain. But you need to use git, so you have a main code base, then you branch that code base to staging. You then can commit file via git to staging, test, then merge staging back into main.

    So you need to google how to do that boy.


This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer