Can't make managed backups or take snapshots

I am not able to make Managed backups or Snapshots. In the last attempt to make a Snapshot it was running fine but stopped at 11% of the final step with an error message that read:

405 NOT ALLOWED
nginx/1.14.1

  • Mohammad Sharab
    • Staff

    Hello Ben,

    Hope you are having a great day.

    I've successfully created a Snapshot backup after:
    1- I've excluded wp-content/uploads directory from the backup to check whether the issue is related to the size of your backup or not.
    2- I've uploaded this code to your mu-plugins folder

    <?php
        function snapshot_custom_size_increment() {
            return 5 * 1024 * 1024;
         }
         add_filter( 'snapshot_model_transfer_part_size_increment', 'snapshot_custom_size_increment' );

    this code helps to solve Snapshot's timeout problem in most cases.

    The created Snapshot size is 94.77 MB. So your issue could be due to the large size of your previous backups and as I notice you're on a shared server which, in most cases, doesn't approve large size backups. Also, it might be a restriction in nginx config.

    After I did some research, I would suggest using the following to solve the problem.

    Please add this code in your nginx site specific config file:
    error_page 405 =200 $uri;

    so it might look like:

    server {
        listen       80;
        server_name  test.com;
    
        root   /my/root;
    
        error_page  405     =200 $uri;
    
        location / {
            index  index.html index.htm;
        }
    
        # ...
    }

    Then, you will need to restart Nginx server.

    As you are on a shared host I would suggest contacting your hosting provider to execute this edit.

    Meanwhile, I will forward the results to our developers, and we will update you once any update comes up.

    Hope this helps and let me know if you need further assistance in this.

    Best Regards,
    Mohammad Sharab

  • Ben
    • New Recruit

    My host added that code and checked that it looked like the example posted above.

    But Snaphshot is still stopping at 11% of the second last step (Files: :media/2014/2014).

    If we can find that file, and delete it, maybe that will fix the problem? I don;t need that file if it's from 2014.

  • Mohammad Sharab
    • Staff

    Hello Ben,

    hope you are having an amazing day.

    After some research, I was able to create a local Snapshot on your site (name:Snapshot-exclude-2014-05) after excluding this folder 2014/2014/5/.

    Here is how I did it, step by step:

    1. To check which folder with the largest size to exclude, go to your cPanel > Disk Space Usage, then scroll down to the part where your folders are listed. After that, you could sort your files by size as shown in the screenshot.

    You can see that the folder with the largest size is 2014/2014/5. If you clicked on it (5) it will open in your file manager where you can sort your files by size to view your larger files. I can see that there are images exceeds 5MB as shown in the screenshot.

    2. To exclude this folder 2014/2014/5, type the folder path in Snapshots > New Snapshot > Files section as shown in the screenshot.

    3. Finally Save and Run Backup.

    Please note that you can manually backup/restore the excluded folder via FTP.

    Hope this helps and please let me know if you need further assistance regarding this.

    Warm Regards,
    Mohammad Sharab

  • Ben
    • New Recruit

    Thanks for such a detailed reply. I don't need media files from 2012-2016, so maybe I just delete the other years?

    I've been adding the ":media/" files that have stopped the Snapshot, into the Global File Exclusion list.

    It stopped again today on a 2017 media file, which I should really keep for now.

    I'm sure the "405 Not Allowed: nginx 1.14.1" error is not the first time this happened to anyone else using this plugin. So why is it being so hard to fix for this domain?

    I'm ready to upload the new website deign to this domain, but the only thing stopping me doing so is just a simple backup of the site first.

  • Mohammad Sharab
    • Staff

    Hey Ben,

    Hope you are having a wonderful day.

    I've checked your available snapshots and I can see 2 snapshots are created before and one of them I created for the whole site (excluding only this folder: uploads/2014/2014/5/). So this shows that the backup part is actually working fine, but the issue is that some limit on the server is reached when you try to back up the ":media/" files and it fails. It seems to be some issue related to timeout configuration in Nginx.
    Can you please ask your hosting provider about the issue as I believe they can better explain it. Also, if you could ask them to check the server logs as that should give us more information on which limit was reached during the backup process.

    Please let me know their response, so we can further check it and see how we can help you fix this.

    Best Regards,
    Mohammad Sharab

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.