I am a new user to wpmudev on a multisite installation.

Hi,

I am a new user to wpmudev on a multisite installation. I am trying to connect dropbox as a destination for snapshot pro, and am getting the following error when I click the button to grant permission to access dropbox.

Warning: Invalid argument supplied for foreach() in /home/readournews/public_html/wp-content/plugins/snapshot/lib/Snapshot/View/Destination/Listing.php on line 33

Per a similar post I read, I saw there could be a conflict with another plugin that also accessed dropbox so I deleted the plugin and am still getting the same error issue. Can you go in there and see what's going on?

Also, I have another question -- For Snapshot Pro, I just want to backup the entire multisite network with all sites included. Which do I select -- "common files" or "select files" and then click all the checkboxes? A little confusing - I just want to be able to backup and restore everything if something fails. Please let me know what to do.

Thank you!

Best,
Cliff

  • faydra_deon

    I just want to backup the entire multisite network with all sites included

    You cannot use Snapshot Pro to backup your multisite in its totality. You must backup one site at a time. Snapshot Pro does not allow for one, all-encompassing backup of everything.

    I cannot speak to the issue you are having with Dropbox, but I'm certain another member or the Staff will be able to address that for you.

    Faydra...

    • faydra_deon

      why do I just see controls for Snapshot Pro on the network admin menu, and not in the individual site menu

      I honestly do not know why you can't create Snapshots in the subsites. My best answer is that is just not the way WPMU Dev configured the plugin, so all snapshots have to be done at the Network Admin level.

      what about the settings for backing up the entire individual site? Should I use "common files" or "select files" and then select all check boxes

      In Network Admin, when you are ready to start creating backups of your subsites, there's a button next to your domain URL that says Change. Notice that its label is Blog to backup. In a single-site install, there is not an option for Blog to backup.

      Once you click Change and indicate which subsite to back up, you will then click Lookup. At this stage, the option to "Include selected files" will disappear. You will only be left with the options of "Do not include files" and "Include common files."

      I hope this helps.

      Faydra...

  • Adam Czajczyk

    Hello Clifford,

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

    The Snapshot Pro plugin is not capable (yet) of making backup of entire Multisite at once so, as member @faydra_deon mentioned, you will want to create separate snapshots for the main site and for each sub-site. Fortunately, that's the "set and forget" type of setup so you only need to do this once :slight_smile:

    Should I use "common files" or "select files" and then select all check boxes?

    In order to create a full backup I'd go for "selected" settings for files and tables and then checked all the check-boxes (for all files and databases).

    why do I just see controls for Snapshot Pro on the network admin menu, and not in the individual site menu?

    The "Network Admin" dashboard is a main "central" for Multisite management. The Snapshot Pro plugin is a tool created for Network administrators (super-admins) and so they could easily backup/restore their entire network or just selected sites of it. When you start creating a new snapshot ("Snapshots -> Add New") you will be given an option to select which blog (main site or any of the sub-sites) you'd like to backup.

    I am trying to connect dropbox as a destination for snapshot pro, and am getting the following error when I click the button to grant permission to access dropbox.

    I admit I'm not sure yet what's causing this as I didn't find any reports of the same error in our internal system. The essential step in troubleshooting issues such as this would be to first re-install plugin (just disable and delete it and then install it again via WPMU DEV -> Plugins page in your Network Admin) and then run a full theme/plugin conflict test as described on the flowchart in this article:

    https://premium.wpmudev.org/manuals/using-wpmu-dev/getting-support/

    Would you please give it a try and let me know of the result?

    Best regards,
    Adam

  • Predrag Dubajic

    Hi Clifford,

    I tried replicating this on my installation but had no luck in doing so, I do see the error on your site though.

    Can you try connecting to Dropbox while Wordfence is deactivated just to check if some of those settings are blocking it?

    Also, could you tell me what was the plugin you removed that used dropbox as well, I would like to do some further testing with it on my installation to see if any leftovers of that plugin could be causing this?

    Best regards,
    Predrag

  • Clifford

    Hi, thank you for your replies regarding this issue!

    To help with the Dropbox issue, I originally did deactivate Wordfence as you suggested, and same problem occurred. For now I have decided to switch to Google Drive. I did so with no errors. However, I have two related questions:

    - How can I control when the .zip file saves to Google Drive? In the upper right of the Snapshots screen, it says, the next "Send" is at 2:00am. Is that when the file Snapshot will save to Google Drive? Is there a way to speed that along?
    - Secondly, the times in that indicator are off by several hours. How do I adjust the clock?

    Thank you!

    Best,
    Cliff

  • Adam Czajczyk

    Hello Clifford!

    For now I have decided to switch to Google Drive. I did so with no errors.

    Thanks for letting us know that, it's great that GDrive worke for you well!

    - How can I control when the .zip file saves to Google Drive? In the upper right of the Snapshots screen, it says, the next "Send" is at 2:00am. Is that when the file Snapshot will save to Google Drive? Is there a way to speed that along?

    Snapshot is using WP Cron (see here please) to run tasks that create copy (local first) and upload archive to Google Drive. As these tasks are often quite time/resource consuming and Cron jobs are limited in term of allowed run time and memory usage, it's usually impossible to complete entire cycle in "one shot". That's why Snapshot is creating a "schedule" for each task (usually broken into many smaller "sub-tasks"). That what you're seeing as "The next Send is at....".

    How fast/often that happens? There are two main factors:

    1) The frequency that you set for snapshot creation ("Snapshot -> All Snapshots -> [selected snapshot edit screen] -> [Backup Interval option])

    2) The WP Cron timeout which is usually 30 or 60 seconds. That means that a single task can take no more than 60 seconds and once that limit is reached, the task gets closed and the next is triggered upon next WP Cron run.

    The downside here is that WP Cron relies heavily on a traffic that your site gets so the less hits there is, the less accurate the timing is.

    The only solution would be to switch to the "real" server Cron but I wouldn't recommend it if not absolutely necessary as it may cause some additional issues with other plugins.

    - Secondly, the times in that indicator are off by several hours. How do I adjust the clock?

    This is indeed a bit surprising. Could you please install this plugin?

    https://pl.wordpress.org/plugins/wp-crontrol/

    Once it's enabled, please go to your "Dashboard -> Tools -> Cron Events" page and see for "Hook Names" including "snapshot_" prefix. Let me know please what you found and keep the plugin enabled so I could then take a look myself.

    Best regards,
    Adam

  • Adam Czajczyk

    Hello Clifford,

    Thanks for your help!

    I've examine your Snapshot settings and also Crontrol output and it seems like the cron tasks are not properly updated by Snapshot and also I've got doubts about WP Cron being executed at all. I admit that's a bit uncommon issue.

    Having said that, I'd like to try something if you don't mind. Could you please add the following line to your site's "wp-config.php" file?

    define( 'ALTERNATE_WP_CRON', true );

    Please place it right above the "/*That's all, stop editing..." line and make sure that your site's getting some traffic.

    I've switched one of your Snapshots from "Twice daily" to "Every 5 minutes" temporarily so we should be able to see the result pretty quick. That said, once you add aforementioned line, just give it a few hours and let me know if anything had changed.

    Best regards,
    Adam

  • Adam Czajczyk

    Hey Cliff,

    I got into my cpanel/cron and do not see any jobs running there

    WordPress is not using "real" CRON but instead it's using its own core procedures known as WP Cron. The idea is basically the same but implementation is much different. While CRON tasks are defined on server level and triggered by server itself, the WP Cron is just another WP function that's taking tasks from the database and that's triggered by site loads.

    Therefore you none of WP Cron tasks/jobs will ever be visible in your cPanel cron settings. Furthermore, none will be triggered if you site is not getting any traffic, though this is an extremely rare case as at least there are search engine bots :slight_smile:

    That said, thanks for making a change and keep me updated please. In case nothing changed for next, let's say, 2-3 hours or so - let me know please and we'll try one more approach.

    Best regards,
    Adam

  • Adam Czajczyk

    Hello Clifford,

    Thanks for your feedback!

    I think we should not try the "ultimate" solution which is switching WordPress to use the real (server) CRON instead of WP Cron. I didn't suggest it before as it's usually better to use core/built in WP solutions but in this case this sounds like better way to go.

    I understand that you already know where to find/setup CRON in your cPanel as you already mentioned it. That said, please try following:

    1. Replace this line in your "wp-config.php" file

    define( 'ALTERNATE_WP_CRON', true );

    with this one:

    define('DISABLE_WP_CRON', 'true');

    This will entirely disable built-in WP Cron.

    2.Follow this guide to setup Cron Jobs:

    http://www.inmotionhosting.com/support/website/wordpress/disabling-the-wp-cronphp-in-wordpress

    If this doesn't work, try replacing this line (mentioned in step #5 of linked guide)

    cd /home/userna5/public_html; php -q wp-cron.php

    with this one

    curl -I http://readournews.com/wp-cron.php?doing_wp_cron

    I've tested this by calling an URL above via browser and it seems it worked (which you can see for yourself on your Snapshots list).

    Best regards,
    Adam

  • Clifford

    Hi Adam,

    We may be almost there. 7 Snapshots appeared in my Google Drive. This occurred a couple hours ago.

    Current situation is, you have the snapshot set to run every five minutes, but I do not see any more running. I have the max number of snapshots set to 10. I also deleted all but two of the backups in Google Drive.

    I am curious why more backups are not going into the drive since it's set at 10 backups. Can you give me some reassurance? Will tomorrow, more backups appear? What should I do now?

    Thank you, Adam.

    Cliff

  • Adam Czajczyk

    Hello Clifford!

    Just to make sure: have you made a changes that I described in my recent post? That's essential step here.

    The archives that appeared several hours ago on your Google Drive were uploaded because of my action, to be precise: I invoked this URL manually via browser (being logged in to your site):

    http://readournews.com/wp-cron.php?doing_wp_cron

    This triggered all WP cron tasks and as a result created the snapshot that's defined to run every 5 minutes and uploaded all other archives. This was however "one-time" manual action. It worked so it proved that the issue is strictly related to Cron. I should mention it in my previous post, I"m sorry for bringing you to confusion on this.

    Now, in order to make it work on permanent-basis, you will want to define server Cron job as explained in my previous post. Once this is done, it all should start working on "auto-pilot".

    Best regards,
    Adam

  • Clifford

    Hi Adam,

    Sorry for the delay in responding! I so appreciate your assistance.

    I did what you requested -- disabled WP Cron, and added a Cron job in my cPanel with the following command:

    cd /home/readournews/public_html; php -q wp-cron.php

    I am not sure what this is supposed to do, exactly -- does this mean any snapshot I have set up will run as scheduled, and will show up in the Google Drive? If I do not see a backup show up in the next few hours, I'll try the alternate command you recommended:

    cd /home/userna5/public_html; php -q wp-cron.php

    Also, a notification in red is showing up, saying, Your site has disabled the WordPress Cron scheduler (WP_CRON). When scheduling an archive to be created it may not run. Check your wp-config.php for the DISABLE_WP_CRON define. If found either remove it or set the value to "false".

    I am assuming that is normal.

    So that is where we stand right now. Will report back if no cron jobs show up in Google Drive.

    Thank you!

    Cliff

  • Adam Czajczyk

    Hello Cliff!

    Hi again, I tested the command "curl -I http://readournews.com/wp-cron.php?doing_wp_cron" that you suggested and it worked great!

    That's great, I'm glad it's working now!

    My question is, for other cron jobs, like for one that your plugin that indexes the site that apparently uses WP-cron, what of those. Will everything still work?

    This all should now work as expected and there's no need to define any new cron jobs for WP in cPanel. That's because when server calls "wp-cron.php" file, that file takes care of the rest.

    The only thing you may want to change in future would be to adjust cron frequency in cPanel but I wouldn't worry about that at this moment, unless you notice some significant delays or some tasks (e.g. snapshots, snapshots' uploads, post indexing from Post Indexer plugin) are being skipped.

    Having said that, I'd leave it "as is" for now and all other "automated tasks" (both native to WordPress as well as created by other plugins) should now be working fine.

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.