[Snapshot Pro] Restoring from Managed Backup Fails

I cannot restore from my Aug 25th backup. I tried autmatic and manual method. I tried to follow this thread:
https://premium.wpmudev.org/forums/topic/snapshot-error-on-restore
but no luck. I really need this restored, my site is messing up. Please help :slight_frown:

  • Adam Czajczyk
    • Support Gorilla

    Hello Mike D,

    I hope you're well today and thank you for your question!

    I have accessed the site that you have assigned to this ticket and the only backup I can see there is a Managed Backup archive from August 24th. Is this the one you'd like to restore?

    I didn't try it because backup restoration is a "permanent thing" so I want to make sure first that I'm dealing with the right one :slight_smile:

    Also:

    - this backup should be restored back to the same site (squ...et.ca), correct?
    - what are the exact errors/messages that you're getting when you try to restore it?

    Let me know please and I'll be happy to assist you with it.

    Best regards,
    Adam

  • Predrag Dubajic
    • Support

    Hi Mike,

    It seems that the file is somehow incomplete when we download it, which is something that shouldn't be happening as we're checking the files before completing the upload to our cloud servers.
    Could you provide us with cPanel access to your site so we can have our devs investigate what happened here?

    And also, could you tell us what exactly is the issue you're having on your site for which you want to restore the backup?

    Note: Don't leave your login details in this ticket.
    Instead, you can send us your details using our contact form https://premium.wpmudev.org/contact/#i-have-a-different-question and the template below:

    Subject: "Attn: Predrag Dubajic"
    - Site login URL
    - WordPress admin username
    - WordPress admin password
    - cPanel credentials (host/username/password)
    - Folder path to site in question
    - Link back to this thread for reference
    - Any other relevant urls/info

    Best regards,
    Predrag

  • Mike D
    • The Bug Hunter

    Could you provide us with cPanel access

    Ok

    could you tell us what exactly is the issue you're having on your site

    I will list the steps how I got to needing a restore:
    -I installed WPMUDEV Dashboard and Snapshot
    -noticed that Dashboard plugin wasn't working properly, support suggested I do a plugin conflict test
    -tried to run a managed backup, didnt work
    -WPMUDEV support made changes to my wp-config
    -ran another managed backup, worked this time
    -went back to my site to do the plugin test, deactivated all and re-activated one by one
    -noticed that the plugin conflict was with WP-Property plugin which is the core plugin of my site

    Prior to this process, the property listings were working properly. These are custom posts that wp-property manages, I have over 6000 listings. After the plugin test, none of the property listings are showing. You can check by clicking the Search menu link at the top of any page and then clicking a property.

  • Predrag Dubajic
    • Support

    Hi Mike,

    Thanks for the additional info about the issue, I was actually able to get your posts to display again just by going to Settings > Permalinks and saving settings there once in order to flush permalinks.

    This is actually a common issue when using custom post type plugins, once you deactivate and activate them it usually needs flushing permalinks to get them working again.

    I wanted to check the backups then as well but the Snapshot panel is not working properly when WP Property plugin is enabled.
    I believe that the issue here is with their ud_get_wp_property function and once that is removed from the plugin the Snapshot loads fine (I performed this test on my installation).

    Could you get in touch with WP Property plugin developers and ask them if ud_get_wp_property can be called only on plugin respective pages instead of on entire WP admin and that should hopefully fix the issue?

    Best regards,
    Predrag

  • Mike D
    • The Bug Hunter

    Predag, thanks a lot buddy, I really appreciate your help. Things are back to normal, you even fixed another issue I was having with wp-property which was the google map api. This is great! I will pass along your advice to the wp-property devs but I dont think they will make changes anytime soon, communicating with them is not so easy. Is there another way to fix it?

    I would like to figure out what happened to the managed backup. Why was the restore file incomplete and what can I do to make sure the backup is reliable?

    • Mike D
      • The Bug Hunter

      Ok, no problem. Please just have them leave a message here when they are going in so I don't touch the site. I will get an email notification. They can use my cpanel credentials to download a cpanel backup if they like. I noticed that I have a softaculous backup folder, which is leftover from when I first started the site with Softaculous. I wonder if it would have something to do with Snapshot errors? I dont know how to undo the softaculous connection but I do know that it is not backing up anything.

      BTW, the plugin conflict between wp-property and dashboard/snapshot seems to have disappeared for now. I re-activated some plugins that I turned off during the plugin conflict test and for some reason there is no sign of the issue anymore.

      Anyways, getting managed backups to work is my number one priority. Thank you.

  • Leonidas
    • Developer

    Hello there Mike D ,

    First, about the wp-property conflict: We had to insert the following custom code in order to bypass said conflict, without deactivating the wp-property plugin. From:

    add_filter(
    	'admin_body_class',
    	array( __CLASS__, 'admin_body_class' )
    );

    to:

    add_filter(
    	'admin_body_class',
    	array( __CLASS__, 'admin_body_class' ),
    	999
    );

    in the assets/shared-ui/plugin-ui.php file
    This does the trick and enables proper access to the Snapshot panel, with wp-property enabled, but as you can realize, it will get lost with the next Snapshot update and it will have to be re-added there, so the best thing here is to see if the wp-property devs will provide a permanent solution.

    Now, about the failed backup: After adding the above custom code, we managed to produce a complete backup, with one caveat. The zip produced from the backup process couldn't begin to be manually restored using the Snapshot Installer, even though it was a completed one. Extracting, deleting and re-adding the uploads folder from the zip using 7zip fixed that and after that the restore process started as it normally would. Since we are talking about a nearly 3GB backup, I didnt have the time to see the restore process to the end, so I'll come back the following days and report the findings here.

    The reason for that inconsistency unfortunately is the huge wpp_import_files folder from the WP-Property Importer Add-on, inside the uploads directory. This particular folder is over 2.7GB in size and has over 100,000 images. As you can understand, these kind of numbers put a great deal of strain in the server and as a result the zipping process is affected.

    What I'm going to do next is, finish a restore with the 7zip-edited backup and check if that manages to fully restore your site to my local server and come back and inform you of my findings. You can work on your site now, as I won't do anything else in there, for now.

    Best regards,
    Leonidas

    • Mike D
      • The Bug Hunter

      I appreciate the feedback Leonidas. Im looking forward to your results with the restore process.

      see if the wp-property devs will provide a permanent solution

      I've had a hard time communicating similar issues with them but maybe you guys could try? They are on Github and you would probably be able to explain it better than me. Just a suggestion, I know its outside your scope but they are the most popular real estate plugin so it might be worth the outreach. I have also left them a message.

      This particular folder is over 2.7GB in size and has over 100,000 images

      I know, but this is the core of my site, lots of fresh properties! Wordpress, WP-Property and Avalon Theme create multiple thumbnails of each imported property image. I dont know how to stop it but Its something I would like to work on once the backups are secured. Im ok with excluding wpp_import_files from regular backups because I can always restore them using WP-Property Importer. Its not ideal but acceptable so long as its noted somewhere. Is it possible to exclude folders and files from managed backups?

  • Predrag Dubajic
    • Support

    Hi Mike,

    I'll ping Leonidas and see if he can get in touch with WP Property devs but a report from user should really be enough to check it out :worried:

    About excluding wpp_import_files folder, you can go to Snapshot > Settings panel and in there you will see "Global File Exclusions" input field.
    Add your folder(s) there and that will do it, folders listed there will be excluded from the backups.

    Best regards,
    Predrag

  • Mike D
    • The Bug Hunter

    Its good to know I can exclude a folder from backups but that would be less than ideal, fragmented restores are usually problematic or time consuming. When something goes wrong, I just want to press a button(restore) and make everything go back to normal as quickly as possible.

    I really hope Leonidas comes back with positive results from the restore test.

      • Mike D
        • The Bug Hunter

        I know, I can see in The Hub the sites you setup and the backup progress of each one. Yikes!

        BTW, I forgot to mention that 12am-6am EST is when I have my big cron jobs, importing/updating properties, setup to run each hour and that might affect the backup speeds. My hosting company creates a backup every Sunday and keeps 3 weeks. Since we know that my site is large, I would be ok with managed backups only twice a week.

        I have been thinking about Snapshot a lot this week. I would like to suggest to the plugin developer to merge the Managed Backup section into the Destinations section because essentially that's what it is, another Destination to choose from. It could be simply listed as WPMUDEV Cloud along side Google Drive, Dropbox, etc in the selection field. Its confusing to think of it as separate from the other backup options.

  • Leonidas
    • Developer

    Hi Mike D ,

    I have a couple of things to report here:

    First of all, the (full) restore I tried, with nothing excluded, didn't work. As I said, the huge wpp_import_files folder wears down the server resources so much that makes the backup process acting up and not producing a clean backup archive. If the server runs intensive processes as well at the same time (like the big cron jobs you mentioned), it's understandably very likely, that those will prevent Snapshot from doing its thing in a predictive way.

    So I continued with the alternative, trying to restore locally, using the Snapshot Installer, from a backup with the wpp_import_files folder excluded, which was a clean and proper backup file, as expected. However this restore process wouldn't produce an exact copy of the original site as well. The reason for that is that there are some serialized entries in the db (that have to do with the child theme styling) that contain newlines in them and those newlines "confuse" the Snapshot Installer which in turn results in those serialized entries breaking. As a result, the restored site's styling is not the same with the original site's styling.

    If all these sound extremely technical and feel that they should't concern you, I'm just sharing those in order to make it known that we have already scheduled to update the Snapshot Installer to deal with those edge cases as well. In fact, we are working on solution which is technically complicated, so we are working on that.

    Keep in mind that this inconsistency with the newlines in serialized db entries doesn't affect the native restore from the Snapshot (meaning, not using the Snapshot Installer, but the actual Snapshot restore from the plugin's pages instead). That means that if you wanted to restore your site using Snapshot's native restore, this issue wouldn't exist and the restored site's styling would not be affected.

    So, our focus of actions regarding your issues will be updating the Snapshot Installer for dealing with newlines in serialized db entries, in order for you to have a means to restore your site seamlessly even in the event of it being unavailable for whatever reason and we will be letting you know about that.

    Best regards,
    Leonidas

  • Mike D
    • The Bug Hunter

    Sorry taking so long to respond, I have been trying to wrap my head around your findings.

    there are some serialized entries in the db (that have to do with the child theme styling) that contain newlines

    Im not surprised, that theme is made from the same developers of the conflicting plugins.

    if you wanted to restore your site using Snapshot's native restore, this issue wouldn't exist

    Yes, I noticed that too. The problem with local backups is that it consumes at least double the space (If I only keep one backup) on my server and will likely prompt my host to complain about large files and server quotas.

    I really, really appreciate you looking into this for me and working on a solution, I look forward to it! My next step will be to work on the theme so that it does not have the newline issues and also figure out how to stop it from creating so many size versions of each image file.

    • Leonidas
      • Developer

      Hi there Mike D :slight_smile:

      it should be mentioned here that those serialized entries with the newlines, are a problem only when trying to locally restore the backup in a Windows setup. Restoring in a Linux setup doesn't face those issues and the the restored site's styling is not affected. As a result, the Installer task is focused on dealing with newlines in serialized entries in a Windows setup (XAMPP, WAMPP, etc.). Just keeping you informed here.

      Best regards,
      Leonidas

      • Mike D
        • The Bug Hunter

        I've been trying to get local restores(without Uploads) to work on my Mac and its not working. They restore always gets stuck on postmeta db table. I have reduced the number of image size options and installed WP Smush to see if cleaning up all the images will help with backups.

        BTW, did you disable my cron jobs? I noticed that they last ran 7 days ago. I cant figure why they stopped working.

        • Leonidas
          • Developer

          Hi Mike D ,

          the last time I accessed your install is longer than 7 days. I think it was on the 6th, but maybe it was on the 7th at latest. And when I did access it, the only thing I did was to produce a backup in order to see what is going on. So, most probably something else is responsible for disabling your cron jobs.

          Also, the issue with the postmeta table is strictly due to server resources. The problem is that the table is just that big and restoring it really depends on the resources of the setup. For example, in my aforementioned XAMPP setup, I had enough server resources to finish the restore. The postmeta table is over 57MB which is, frankly, not optimal and that's why some setups will have a problem restoring it.

          Best regards,
          Leonidas

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.