How to fix the SQL_MODE restore failed error
If an UpdraftPlus restoration stops with a Restore failed message, the SQL_MODE safety check may be preventing the database import from continuing. This doesn't necessarily mean your backup is damaged.
This guide explains what the check does and how to retry the restoration if your restore log specifically mentions UPDRAFTPLUS_ALLOW_SQL_MODE_FAILURE.
If you need help with the usual restoration process first, see how to restore a WordPress backup with UpdraftPlus.
What does the SQL_MODE error mean?
Your restoration might stop with a message such as:
0000.135 () Restore failed...
The final message alone doesn't tell you what went wrong. Check the restoration log for an earlier message saying that UpdraftPlus couldn't set or verify the database's SQL mode. In some cases, the log mentions:
UPDRAFTPLUS_ALLOW_SQL_MODE_FAILURE
UpdraftPlus checks SQL mode before importing a database to reduce the risk of compatibility problems. MySQL and MariaDB use SQL_MODE to control how certain database operations are handled, and settings can differ between hosting environments.
For example, a backup created on an older MySQL server may contain dates or values that a newer server handles more strictly. Without the check, an import could fail partway through or leave some records unrestored, even if the website initially appears to work.
If UpdraftPlus can't confirm that it has applied the appropriate SQL mode, it may stop the restoration as a precaution. That doesn't automatically mean the backup itself is faulty.
Before you begin
Only use the workaround below if your restoration log identifies SQL mode verification as the problem and mentions UPDRAFTPLUS_ALLOW_SQL_MODE_FAILURE.
Before editing anything:
- Keep a copy of your original website backup.
- Download a copy of your existing
wp-config.phpfile so you can restore it if needed. - Be aware that bypassing this check does not fix database compatibility problems. You'll need to inspect the restoration log and test the website afterwards.
How to fix the SQL_MODE restore failed error
Step 1: Access your WordPress files
Log in to your hosting account and open its File Manager, usually available through cPanel, Plesk or a similar control panel. You can also connect using an FTP or SFTP client.
Navigate to your WordPress installation folder. On many websites, this is public_html.
Step 2: Open wp-config.php
Find wp-config.php in your WordPress installation folder. It contains important WordPress settings, including database connection details.
Download a copy of the file before making changes, then open it in your hosting provider's text editor.
Step 3: Add the SQL_MODE workaround
Towards the bottom of wp-config.php, find a line similar to:
/* That's all, stop editing! Happy publishing. */
Immediately above that line, add:
define('UPDRAFTPLUS_ALLOW_SQL_MODE_FAILURE', true);
Save the file.
What does this change do? It tells UpdraftPlus to continue even if it cannot verify the SQL mode setting. It does not change your MySQL server settings or repair database problems. That's why this should be a temporary workaround for the specific error described above.
Step 4: Retry the restoration
In your WordPress dashboard, go to Settings → UpdraftPlus Backups.
Find the backup you want to restore, select Restore, then choose the components you need, such as the database, plugins, themes and uploads.
Start the restoration again and monitor the log. If the SQL mode check was the only issue, UpdraftPlus should now be able to move past that point.
For a walkthrough of the normal process, see how to restore a WordPress backup.
Step 5: Check the restored website
Once the restoration finishes, check that your website is working as expected:
- Open the homepage and a selection of other pages.
- Check that images load and plugins work correctly.
- If you use WooCommerce, check products, orders and other important store data.
- Review the restoration log for database import errors.
A completed restoration doesn't always guarantee that every record was imported correctly, especially when you've bypassed a database safety check.
Step 6: Remove the workaround
Once you've confirmed that the restoration completed successfully and the database is working correctly, reopen wp-config.php.
Remove the line you added in Step 3:
define('UPDRAFTPLUS_ALLOW_SQL_MODE_FAILURE', true);
Save the file again. This allows UpdraftPlus to use its normal SQL mode safety check for future restorations. Don't leave the workaround enabled permanently.
What if the restoration still fails?
If the restoration fails again, the SQL mode check may not be the only problem. Possible causes include insufficient database user permissions, database version incompatibility or incomplete backup files.
Check the restoration log and look for the first meaningful error, rather than relying only on the final Restore failed message.
If you're unable to access your WordPress dashboard, see how to restore a backup manually without wp-admin. For multisite restorations, there's also a guide to restoring a single site from a multisite installation.
If you're unsure what the log means, contact your hosting provider or UpdraftPlus support and share the relevant entries. They can help establish whether the issue relates to database settings or another part of the restoration.
Is it safe to bypass the SQL_MODE check?
It can be appropriate when the log identifies this specific problem, but bypassing the check removes a safeguard designed to catch database compatibility issues.
If the database and hosting environment are otherwise compatible, the restoration may finish without problems. If there's a genuine incompatibility, however, the import could still fail or leave data missing.
Keep your original backup, review the log and test the restored site carefully. For an important business website, testing the restoration on a staging site first is the safer option.
For more guidance, browse the UpdraftPlus documentation. You can also learn more about UpdraftPlus backup and restoration features.