• Resolved softwaredancer

    (@softwaredancer)


    Total Upkeep Backup is not backing up the database in an xampp installation

    Total Upkeep Backup is working fine for me on a site hosted by GoDaddy, but failing on my local PC where I am running Windows 10 Pro and xampp ver 7.3.26 for windows. This version of xampp features the MariaDB 10.4.17 and PHP 7.3.26 (VC15 X86 64bit thread safe).

    On my xampp site, even though I specify “Backup all tables (full backup)” for the database (the default setting), no database backup file is included in the the zip backup file.

    The log file shows that all of the database tables have been excluded:

    ***********************
    *  Start of Log File *
    ***********************
    [2021-02-08 00:16:17 UTC] Cannot add signal handlers, pcntl_async_signals function does not exist.
    [2021-02-08 00:16:17 UTC] Last error: Array
    (
        [type] => 2
        [message] => file_get_contents(I:\lh\KeaneWP\BU\logs-50ff40a5-c84e31302a358731\archive-1612743377.log): failed to open stream: No such file or directory
        [file] => I:\lh\KeaneWP\site\wp-admin\includes\class-wp-filesystem-direct.php
        [line] => 39
    )
    
    [2021-02-08 00:16:17 UTC] Backup process initialized.
    [2021-02-08 00:16:17 UTC] --------------------------------------------------------------------------------
    [2021-02-08 00:16:18 UTC] Starting dump of database...
    [2021-02-08 00:16:18 UTC] Memory usage - limit / current / peak memory usage: 1073741824 / 45392632 (43.29 MB) / 46003464 (44 MB)
    [2021-02-08 00:16:18 UTC] No database tables selected to backup. A database export will not be in this backup.
    [2021-02-08 00:16:18 UTC] Dump of database complete! $status = 1
    [2021-02-08 00:16:18 UTC] Memory usage - limit / current / peak memory usage: 1073741824 / 45393536 (43.29 MB) / 46003464 (44 MB)
    [2021-02-08 00:16:18 UTC] --------------------------------------------------------------------------------
    [2021-02-08 00:16:18 UTC] Starting archiving of files. Chosen compressor: php_zip
    [2021-02-08 00:16:18 UTC] Memory usage - limit / current / peak memory usage: 1073741824 / 48731448 (46.47 MB) / 49334232 (47 MB)
    [2021-02-08 00:16:54 UTC] Total files / size archived: 5227 / 114509793 (109.21 MB)
    [2021-02-08 00:16:54 UTC] Starting to close the zip file.
    [2021-02-08 00:16:54 UTC] Memory usage - limit / current / peak memory usage: 1073741824 / 48819856 (46.56 MB) / 49334232 (47 MB)
    [2021-02-08 00:16:59 UTC] Finished closing the zip file.
    [2021-02-08 00:16:59 UTC] Memory usage - limit / current / peak memory usage: 1073741824 / 48819776 (46.56 MB) / 49334232 (47 MB)
    [2021-02-08 00:16:59 UTC] Archiving of files complete!
    [2021-02-08 00:16:59 UTC] Archive filepath / size: I:\lh\KeaneWP\BU\boldgrid-backup-keanewp-50ff40a5-20210208-001618.zip / 52029384 (49.62 MB)
    [2021-02-08 00:16:59 UTC] Memory usage - limit / current / peak memory usage: 1073741824 / 48819216 (46.56 MB) / 49334232 (47 MB)
    [2021-02-08 00:16:59 UTC] Starting sending of email...
    [2021-02-08 00:17:01 UTC] Last error: Array
    (
        [type] => 2
        [message] => mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
        [file] => I:\lh\KeaneWP\site\wp-includes\class-phpmailer.php
        [line] => 700
    )
    
    [2021-02-08 00:17:01 UTC] wp_mail_failed: Array
    (
        [wp_error] => WP_Error Object
            (
                [errors] => Array
                    (
                        [wp_mail_failed] => Array
                            (
                                [0] => Could not instantiate mail function.
                            )
    
                    )
    
                [error_data] => Array
                    (
                        [wp_mail_failed] => Array
                            (
                                [to] => Array
                                    (
                                        [0] => xxxxx@hotmail.com
                                    )
    
                                [subject] => Backup completed for keanewp
                                [message] => Hello,
    
    A backup archive has been created for keanewp.
    
    Backup details:
    Estimated Pause: 0.35 seconds
    Duration: 41.26 seconds
    Total size: 109.21 MB
    Archive file path: I:\lh\KeaneWP\BU\boldgrid-backup-keanewp-50ff40a5-20210208-001618.zip
    Archive file size: 49.62 MB
    Compressor used: php_zip
    Backup triggered by: admin (xxxxxxxxxxx@gmail.com)
    
    FILE AND FOLDER SETTINGS
    Included: WPCORE,/wp-content
    Excluded: .git,node_modules
    
    DATABASE SETTINGS
    Tables Excluded: wp_actionscheduler_actions,wp_actionscheduler_claims,wp_actionscheduler_groups,wp_actionscheduler_logs,wp_aioseo_notifications,wp_aioseo_posts,wp_commentmeta,wp_comments,wp_links,wp_options,wp_postmeta,wp_posts,wp_sbi_instagram_feeds_posts,wp_sbi_instagram_posts,wp_term_relationships,wp_term_taxonomy,wp_termmeta,wp_terms,wp_usermeta,wp_users
    
    You can manage notifications in your WordPress admin panel, under Total Upkeep settings.
    
    For help with restoring a Total Upkeep archive file, please visit: https://www.boldgrid.com/support/advanced-tutorials/restoring-boldgrid-backup/
    
    Want to store your backups on Google Drive and Amazon S3, restore individual files with just a click, and have access to more tools? Get Total Upkeep Premium! - https://www.boldgrid.com/update-backup?source=bgbkup-email
    
    Best regards,
    
    The Total Upkeep plugin
    
                                [headers] => Array
                                    (
                                        [X-Mailer] => PHP/7.3.26
                                    )
    
                                [attachments] => Array
                                    (
                                    )
    
                                [phpmailer_exception_code] => 2
                            )
    
                    )
    
            )
    
        [last_error] => Array
            (
                [type] => 2
                [message] => mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
                [file] => I:\lh\KeaneWP\site\wp-includes\class-phpmailer.php
                [line] => 700
            )
    
    )
    
    [2021-02-08 00:17:01 UTC] Sending of email complete! Status: 
    [2021-02-08 00:17:01 UTC] Backup complete!
    [2021-02-08 00:17:01 UTC] Memory usage - limit / current / peak memory usage: 1073741824 / 49402544 (47.11 MB) / 55100272 (53 MB)
    
    ********************
    *  End of Log File *
    ********************
Viewing 13 replies - 1 through 13 (of 13 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @softwaredancer You posted email addresses in that log dump, don’t do that. Also please do not post large code or responses like that here, it doesn’t work after ~10 lines or so.

    If you need share that data please use https://gist.github.com/ or https://pastebin.com/ instead and post the link to that paste.

    Plugin Contributor Jesse Owens

    (@jessecowens)

    Hi @softwaredancer

    Thanks for reaching out! I’m sorry to hear about the trouble backing up your local database.

    Something odd is definitely going on, since you mentioned that you have Back up all tables selected, but all of your tables are listed as excluded in this log:
    [2021-02-08 00:16:18 UTC] No database tables selected to backup. A database export will not be in this backup.
    Can you double-check that all the database tables are selected?

    I tested the plugin on XAMPP (although I’m running XAMPP for Linux, not Windows) and it did work for me as expected.

    One thing I might speculate is that your MySQL (MariaDB) user may not have full permissions to your database. One way to test this would be on the command line, using the same credentials from your (local) wp-config.php file:

    mysql -u (DB_USER) -p(DB_PASSWORD)
    shell> mysqldump --databases (DB_NAME) > test_dump.sql

    Another possibility I might recommend is LocalWP which is a very user-friendly local WordPress environment that “just works.”

    Thread Starter softwaredancer

    (@softwaredancer)

    I traced the problem to function get_from_post() in file boldgrid-backup\admin\class-boldgrid-backup-admin-db-omit.php.

    This function queries $_POST[‘include_tables’] for a set of tables to be included in the backup, and determines what to exclude as all tables except those to be included.

    The problem in my installation is that the $_POST[‘include_tables’] returns an empty array, and so all tables are excluded.

    The brute force solution is to insert the following line
    $exclude_tables = array();
    directly above:
    return $exclude_tables;
    in this function.

    This fixes the problem by returning an empty array for the list of tables to be excluded. A complete database backup is then included in the backup file.

    But a real fix of the problem will have to look at why $_POST[‘include_tables’] returns an empty array. It appears to me that a javascript program
    (boldgrid-backup\admin\js\boldgrid-backup-admin-backup-now.js) is run when the user presses the ‘backup now’ button, and this program is responsible for populating the _POST supervariable with an array of tables to be included. That javascript program is where the program fails, but I lack the javascript expertise to determine what the problem is.

    However, it seems like this bug is worth fixing. When the backup fails, it does so silently; there is no error message – other than a note in the log file that no database tables were backed up. I suspect a lot of people are creating backups not realizing that that a database backup is not included with a backup of their files.

    Plugin Contributor Jesse Owens

    (@jessecowens)

    Hi @softwaredancer

    Thanks for the response, that’s an absolutely awesome amount of work you did to get that information for us.

    We’re looking to try and replicate this issue, so there’s a couple things I’d like to ask you for.

    First, can you describe exactly the steps you’re taking when this issue occurs? For example, what page are you on when you initiate the backup, and what exactly you’re using in the “Backup Site Now” form.

    Depending on your settings, we wouldn’t expect the include_tables array to be populated if you’ve selected “Backup all tables” radio button. I took a minute to record a short video showing you how to inspect the submitted form data in your browser’s dev tools.

    If you have a few minutes, would you mind watching this and letting us know what form data you’re seeing when you create your backup?

    Thread Starter softwaredancer

    (@softwaredancer)

    Hi Jesse,

    Thank you for your response. I’m more than happy to help.

    I did some further testing of the plugin. When you call up the plugin from the admin page of WordPress, you are presented with a page featuring many tabs: Dashboard, Backups, Transfers, Tools, Settings, Preflight Check, Support and Premium Features. Regardless of which tab you are on, you see the ‘Backup Site Now’ button presented near the top of the page.

    It turns out that the backup works properly when you are on any tab other than the ‘Settings’ tab. But when you are on the ‘Settings’ tab and press the ‘Backup Site Now’ button, the backup file it creates will not include your database backup file. When you are on the ‘Settings’ tab, the URL displayed in the browser is ‘[domain]/wp-admin/admin.php?page=boldgrid-backup-settings’. In other words, the referring page is ‘boldgrid-backup-settings’.

    I followed the instructions on your video, and it appears to me that if when the ‘Backup Site Now’ button is pressed from the Settings tab, the javascript program fails to write the ‘table_inclusion_type’ variable. But when you press ‘Backup Site Now’ from any other tab, this variable is written.

    I ran 5 trials:
    Trial From Dashboard Tab, Full Backup. Outcome: Works as expected
    Trial From Dashboard Tab, Custom Backup. Outcome: Works as expected
    Trial From Settings Tab, Full Backup. Outcome: failed to include DB file in backup file
    Trial From Settings Tab, Custom Backup (specify all tables). Outcome: failed to include DB file
    Trial From Settings Tab, Custom Backup (specify all but one table). Outcome: failed to include DB file

    The full contents of the form data from these trials are pasted here:
    https://pastebin.com/M1bFpjaW

    If there is anything else I can do to help, I’ll be more than happy to to do that.

    Best,
    softwaredancer

    Plugin Contributor Jesse Owens

    (@jessecowens)

    Hi @softwaredancer

    Thank you very much for the detailed troubleshooting information! I really appreciate how much help you’ve been willing to offer with this bug.

    We’ve been able to replicate the bug now, and I’ve filed a bug report on our GitHub repository.

    Stand by for an update to the plugin to resolve this for you, and I’ll post an update here when it’s released.

    Thread Starter softwaredancer

    (@softwaredancer)

    Thanks for all your good work in nailing this down, and for the bug report you filed, which looks just fine.

    When first I stumbled upon this problem, I had thought it was specific to my xampp installation. I also have the plugin installed in an site hosted by GoDaddy, and at that time the plugin appeared to be working correctly there.

    However, now that I understand that the problem is triggered by pressing the ‘Backup Site Now’ button from the Settings Pane, I was able to replicate the bug on my GoDaddy installation. So the problem is not specific to xampp. And I want to make that clear, here in this forum.

    Obviously, the workaround is to press the ‘Backup Site Now’ from any pane other than the Settings Pane. I’ve tested it from all the other panes, and the backup always works just fine.

    Plugin Contributor Jesse Owens

    (@jessecowens)

    Hi @softwaredancer

    Yes, I’ll admit the XAMPP “red herring” threw me off at first too, but I was also able to replicate it in other environments, as long as I was on the “Settings” tab.

    You’re right that other pages and tabs work for manual backups, and this issue doesn’t affect scheduled backups either.

    Plugin Contributor Jesse Owens

    (@jessecowens)

    Hi @softwaredancer

    We have a patch for this bug available in a testing branch of the plugin. If you’d like to give it a shot, here’s how you can do it.

    First, install and activate the WP Rollback Plugin, which lets you switch versions of plugins. Then, navigate to Plugins > All Plugins, and locate the rollback link next to Total Upkeep.

    From here, look for the branch.issue-445.202102111509 branch (very near the bottom of the list) and click Rollback.

    Here’s a quick video on using WP Rollback to try out a testing branch (this video was from another patch, make sure you use branch.issue-445.202102111509):

    Thread Starter softwaredancer

    (@softwaredancer)

    Hi Jesse,

    That WP Rollback plugin is very cool. Thank you for introducing me to it.

    Following your instructions, I tested the patch from ‘branch.issue-445.202102111509’. I noticed that a lot of work has been done on the javascript file (wp-content\plugins\boldgrid-backup\admin\js\boldgrid-backup-admin-backup-now.js).

    Unfortunately, the problem remains. When you run a backup from the ‘Settings’ tab, the program still does not write the ‘table_inclusion_type’ variable, and in consequence the database dump file is not included in the backup.

    Plugin Author Brad Markle

    (@bwmarkle)

    Hi @softwaredancer, thanks for taking some time to test the new branch, and I’m sorry it wasn’t working right away for you.

    As you stated, the new changes are in javascript. Are you able to clear your cache and test again? I’m pretty sure the new changes should resolve the issue, we just need to make sure the new javascript is being loaded and not the old. IE When you go to yourdomain.com/wp-content\plugins\boldgrid-backup\admin\js\boldgrid-backup-admin-backup-now.js you should see the new js.

    The way I tested is that I installed the patch version in a free WordPress testing environment. If you click this link and then click “try it” (no need to sign up), it’ll install a new WordPress site with the branch.issue-445.202102111509 branch of the backup plugin installed. From there, I created a backup on the settings page, and my database was backed up.

    Thread Starter softwaredancer

    (@softwaredancer)

    Hi Brad,

    You are absolutely correct in your suspicion that my problem was a failure to clear the cache after installing the patch.

    When I did that, the patch worked just fine.

    My compliments on addressing this issue so quickly and effectively. Total Upkeep is a great plugin, and your work in supporting it is most impressive.

    Best,
    softwaredancer

    Plugin Contributor Jesse Owens

    (@jessecowens)

    Hi @softwaredancer

    This patch has now been included in the 1.14.11 release, so you can now update to the current version of the plugin.

    Thanks so much for discovering this bug and helping us get it fixed! Please let us know if you have any other issues or questions, we’re happy to help.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Total Upkeep Backup is not backing up the database in an xampp installation’ is closed to new replies.