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:
define('SNAPSHOT_TABLESET_CHUNK_SIZE', 200);
define('SNAPSHOT_FILESET_CHUNK_SIZE', 50);

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:
    wp_term_relationships.sql
    wp_postmeta.sql
    wp_posts.sql
    wp_ebayaffinity_log.sql

    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,
    Predrag

  • Darren

    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 https://allorganicstore.com.au to my staging website at https://teambuilder.net.au/ao/

  • 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,
    Predrag

  • Darren

    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