Snapshot restore is getting 504 gateway timeout

When I try to restore, after running for 5 mins it's showing 5-4 gateway error. I have also enabled debug log, but the file is not generated.

I have increased execution time and input time to 300 as well as the following defines:

But no help!

  • Predrag Dubajic

    Hi Darren,

    Hope you're doing well.

    I had a look at your backup file and I can see that you have huge database tables, one of them even going over 1GB.
    This can require a lot of resources and probably causing your server to run out of resources.

    Can you try doing a restore only of your database but exclude these tables:

    Those 4 are the largest ones and excluding them should reduce the server load.
    If the restore process works after that then try restoring those 4 one by one in separate restore processes and see if that works.

    Let us know how it goes.

    Best regards,

  • Darren Utteridge

    I've tried backing up only portions of the database at a time as indicated in my last post above. These all failed to import. I was successful in backing up, just when I tried to import or restore the files, I got the 504 gateway time-out nginx message again.

    I'm now at a loss has to how I'm going to migrate this website from the live site at to my staging website at

  • Predrag Dubajic

    Hi Darren,

    There doesn't seem to be anything wrong with your first backup, it's just that the files are too large for server to handle it, so creating new ones will not fix this as it will create the same databases.

    Snapshot is a standard PHP plugin and uses PHP to handle both creation and restoring of backup files, the thing is that PHP can be resource heavy and your server needs to be able to handle such number of requests.

    I would suggest getting in touch with your hosting provider so they can check the server logs and see which limits are exactly being hit during the restore process and perhaps they can increase those for you, at least temporarily until the restore is finished.

    Best regards,

  • Darren Utteridge

    Hi Predrag,

    My client has a VPS host. I created a sub-domain on her VPS and had the Tech Support Team at Quadra Hosting copy her entire website over to the sub-domain for me. They had some trouble doing so as the site is so big. Apparently there was a log file from a plugin that was 1.4 Gb in size.

    Anyhow, I managed to be able to test her website by turning off all the plugins on this staging site on the sub-domain.

    I found the issues with the poor performance of her e-commerce website.

    So thank you very much for all your help. This ticket can now be closed as resolved. The website was just too big for any migration plugin to work.

    Best regards,
    Darren Utteridge

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.