WordPress Backup Not Restoring Properly - Troubleshooting
You have a disaster. Your WordPress site is broken, hacked, or corrupted.
You need to restore from backup.
You download your backup file. You're ready to recover.
And then one of these happens:
- "Lost connection to MySQL server"
- "Database error" or "couldn't import database"
- "File too large" or "Max execution time exceeded"
- Import finishes but site is completely broken
- Only half the site restores, pages are missing
- "Table already exists" errors
- Restore completes but database is empty
- Files extract but permissions are wrong
Your backup won't restore. You can't recover. You're still stuck with the broken site.
A client of ours got hacked. Their backup was 2GB. They tried restoring via phpMyAdmin. The import timed out at 1GB. They tried twice more, got the same error. Their backup was useless.
They thought their backup was corrupted. It wasn't. They just didn't know how to handle large backups.
Backup restoration failures are incredibly common and incredibly frustrating. You did everything right by backing up. You should be able to trust that backup. But then it fails and you panic.
The good news: Restore failures almost always have fixes. The backup is usually fine. The restoration process just needs adjustment.
Why Backups Fail to Restore
Understanding the cause tells you which fix to use.
- File too large: Database or backup file exceeds server limits
- Memory limit: Restoring requires more PHP memory than available
- Execution timeout: Restoration takes longer than timeout allows
- Database connection lost: Server drops connection mid-restore
- Plugin conflicts: A plugin breaks the restore process
- Charset/encoding issues: Database encoding doesn't match backup
- Table prefix mismatch: Backup has different table prefix than target
- File permissions wrong: Files restore but can't be executed
- Corrupted backup: Backup file is damaged or incomplete
- Search and replace issues: URLs updated incorrectly during restore
Step 1: Verify Your Backup File is Valid
Before trying to restore, confirm the backup isn't corrupted.
Check backup file size
- Download your backup file (if not already downloaded)
- Check the file size
- Compare to what your backup plugin says the size should be
- If actual size is much smaller, backup might be incomplete
Verify backup file type
Depending on your backup plugin, look for one of these:
- .zip file: Compressed archive (most common)
- .tar.gz file: Compressed tar archive
- .sql file: Database dump only
- .wpvault file: UpdraftPlus format
Test if the file is extractable
- On your computer, try extracting the backup file
- Use 7-Zip, WinRAR, or built-in extraction tool
- If extraction fails, backup file is corrupted
- If extraction succeeds, see what's inside
If backup is corrupted
Try to get an older backup.
- Check if your backup plugin stored multiple backup copies
- Most plugins keep 2-4 backups (UpdraftPlus, BackWPup, etc.)
- Try restoring from a backup from a week earlier
- If that works, restore and update from there
If you have no uncorrupted backups: Contact your hosting provider. Most maintain automatic backups on their server.
Step 2: Try a Different Restoration Method
Different methods work better for different situations. Try a different approach.
Method A: Use your backup plugin's restore function
This is the easiest method if your plugin has a restore button.
- If your backup plugin is still installed, use it to restore
- Go to your backup plugin's settings (UpdraftPlus, BackWPup, etc.)
- Find "Restore" button next to your backup
- Click "Restore"
- The plugin handles all the complexity
- After restore completes, check if site works
Why this works: Backup plugins know their own backup format. They handle large files, timeouts, and permissions automatically.
Method B: Use hosting's one-click restore
Some hosting provides one-click restore in their control panel.
- Log into your hosting control panel (cPanel, Plesk, etc.)
- Look for "Backups" or "Restore" section
- See if automatic backups are available
- Select a backup date
- Click "Restore"
- Hosting handles the entire process
- Site should be restored within minutes
Advantage: Hosting backups bypass all the limits that make phpMyAdmin fail. They have direct server access.
Method C: Restore via SSH command line
This works for large backups that phpMyAdmin can't handle.
- Connect via SSH
- Navigate to your WordPress directory
- If backup is .zip, extract it:
unzip backup-file.zip - If backup is .sql, import it:
mysql -u username -p database_name < backup-file.sql - Wait for import to complete (can take 30 minutes for large backups)
- Check if site loads
Why this works: SSH doesn't have the timeout or file size limits that phpMyAdmin has. Large backups import reliably.
Method D: Manual restore via FTP + database restore
- Extract backup file on your computer
- Connect via FTP
- Delete all files on the server
- Upload extracted files from backup
- Import database separately via phpMyAdmin
Why this works: Separating file and database restore avoids timeouts on either step.
Step 3: Check PHP Limits and Increase Them
PHP limits often prevent large backup imports. Increase them.
Check current PHP limits
- Log into wp-admin
- Go to Tools > Site Health
- Look for:
- PHP memory limit (should be 256MB+)
- Max upload size (should be 256MB+)
- Max post size
- Max execution time (should be 300+ seconds)
Increase limits via wp-config.php
- Connect via FTP
- Download wp-config.php
- Add these lines BEFORE "That's all, stop editing!":
define( 'WP_MEMORY_LIMIT', '512M' ); define( 'WP_MAX_MEMORY_LIMIT', '1024M' ); @ini_set( 'upload_max_filesize', '512M' ); @ini_set( 'post_max_size', '512M' ); @ini_set( 'max_execution_time', '600' ); - Save and upload
- Try restoring again
Increase limits via .htaccess
Add this to .htaccess (in WordPress root):
php_value upload_max_filesize 512M
php_value post_max_size 512M
php_value max_execution_time 600
php_value memory_limit 512M
If that doesn't work
Your hosting might have hard server limits. Contact them and ask to temporarily increase PHP limits for backup restoration.
Step 4: Disable Plugins Before Restoring
A plugin might interfere with restore process. Disable all plugins first.
Disable via FTP
- Connect via FTP
- Go to wp-content/plugins/
- Rename plugins folder to plugins-disabled
- Try restoring again
- If restore works, re-enable plugins one at a time
Common plugins that interfere
- Backup plugins: If you have 2 backup plugins, they conflict
- Security plugins: Wordfence, iThemes Security block database changes
- Custom plugins: Any plugin with a __construct() that runs on init
- WooCommerce: Complex database schema can cause import issues
Step 5: Restore Database via phpMyAdmin Properly
phpMyAdmin has specific settings for large imports. Use them correctly.
Prepare for large database import
- Go to phpMyAdmin
- Click on your database (not a table, the database itself)
- Click "Import" tab
- Look at "Location of the text file" section
Settings for large files
- Format: Set to "SQL" (if importing .sql file)
- Partial import: Leave unchecked
- Character set: Usually utf8mb4 (check if your old database was different)
- Skip existing tables: UNCHECK this (you want to overwrite)
- Don't show this menu again: Leave unchecked
Upload the backup file
- Click "Choose File"
- Select your .sql backup file
- Click "Open"
- Click "Go" to start import
If import times out
Use SSH command line instead (see Step 2 Method C).
phpMyAdmin has hard limits you can't overcome through the web interface.
If you get charset errors
Error: "Incorrect string value for column..."
- This means database encoding doesn't match backup
- The backup was likely utf8, target is utf8mb4 (or vice versa)
- Try importing with Character set: utf8 (not utf8mb4)
- If that fails, convert the backup file before importing
Step 6: Check Database Table Prefix
If your site has a non-standard table prefix, database import might skip tables.
What is table prefix?
By default, WordPress tables start with "wp_" (wp_posts, wp_users, etc.).
Some sites have custom prefix like "abc_" or "site123_".
Check what prefix your current site uses
- Open wp-config.php via FTP
- Look for line:
$table_prefix = 'wp_'; - Note the prefix
Check what prefix your backup uses
- Extract backup .sql file
- Open it in a text editor
- Look for lines like:
CREATE TABLE wp_postsorCREATE TABLE abc_posts - Note what prefix is used
If prefixes don't match
Use Find and Replace in the .sql file.
- Open .sql in text editor
- Find and Replace: old_prefix_ β new_prefix_
- Save the file
- Upload and import
Or: Import as-is, then use phpmyadmin to rename tables after import.
Step 7: Check File Extraction and Permissions
Even if database restores, files might not be in right place or have wrong permissions.
Verify files extracted to correct location
- Connect via FTP
- Navigate to your WordPress root
- Check if wp-admin, wp-content, wp-includes folders exist
- Check if wp-config.php exists
- If files are in a subfolder (like "wordpress/"), move them up one level
Check file permissions
- Check wp-content/uploads folder: should be 775
- Check wp-config.php: should be 644
- Check .htaccess: should be 644
- Check all PHP files: should be 644
- Check all folders: should be 755
Fix file permissions via FTP
- Right-click file/folder
- Select "File Permissions" or "Properties"
- Change to correct value
- Apply recursively to all files inside
Fix via SSH
chmod -R 755 wp-content/
chmod -R 755 wp-admin/
chmod -R 755 wp-includes/
chmod 644 wp-config.php
chmod 644 .htaccess
Step 8: Run WordPress repair tools after restore
After restoring database, run WordPress repair to fix any issues.
Enable WordPress repair mode
- Open wp-config.php via FTP
- Add this line BEFORE "That's all, stop editing!":
define( 'WP_ALLOW_REPAIR', true ); - Save and upload
Run repair
- Visit yoursite.com/wp-admin/maint/repair.php
- WordPress scans database
- Fixes common issues automatically
- Shows report of what was fixed
After repair completes
- Remove the WP_ALLOW_REPAIR line from wp-config.php
- Save and upload
- This prevents unauthorized access to repair tool
Step 9: Search and Replace to Fix URLs
After restore, domain URLs might be wrong. Fix them with Search and Replace.
Why URLs break after restore
If you restored to a temporary domain (staging.example.com), all URLs in the database still point to the old domain (example.com).
Fix via plugin
- Install "Better Find and Replace" plugin
- Go to Tools > Better Find and Replace
- Find: http://oldsite.com β Replace: http://newsite.com
- Also do https variations
- Also do www and non-www variations
- Click Replace All
- Verify site loads correctly
If you can't access wp-admin to install plugin
Use SSH to run WP-CLI command:
wp search-replace 'http://oldsite.com' 'http://newsite.com'
Be careful with Search and Replace
Always test in a staging environment first. Search and Replace can break things if done wrong.
Step 10: Enable Debug Logging to See Actual Errors
If restore partially works but site is broken, enable debug to see errors.
Enable debug mode
- Open wp-config.php
- Add before "That's all, stop editing!":
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_DISPLAY', false ); define( 'WP_DEBUG_LOG', true ); - Save and upload
Load your site and check debug log
- Visit yoursite.com (this triggers errors)
- Go to wp-content/debug.log
- Download it via FTP
- Open in text editor
- Look for error messages that explain what's broken
Common debug errors after restore
| Error | Cause | Fix |
|---|---|---|
| "Error establishing database connection" | Database credentials wrong | Check wp-config.php database name, user, password |
| "Table doesn't exist" | Database import didn't complete | Verify all tables in phpMyAdmin |
| "Plugin file missing" | Plugin files didn't restore | Re-upload plugin files via FTP |
| "Theme not found" | Theme files incomplete | Re-upload theme folder via FTP |
| "Undefined function" | Plugin not loading | Verify plugin files in wp-content/plugins |
Real-World Backup Restore Failure
Scenario: An e-commerce site got hacked. The owner had a backup from UpdraftPlus. They tried to restore via the WordPress admin. Restore got to 45% and timed out. Then they tried againβsame result.
What they tried:
- Restore via UpdraftPlus: Times out at 45%
- Restore via phpMyAdmin: Database too large (1.2GB)
- Contacted hosting: They said "use command line"
- Didn't know command line, gave up
- Site was hacked for a week
What they should have done:
- Connected via SSH
- Increased PHP memory limit to 1024M
- Increased max_execution_time to 600 seconds
- Ran database restore via SSH:
mysql -u user -p db < backup.sql - Waited 20 minutes for import to complete
- Restored files via FTP
- Ran WP repair tool
- Site recovered in 4 hours
The lesson: Large backups need SSH and increased limits. Web interface tools fail with large data.
Backup Restoration Troubleshooting Checklist
Backup won't restore?
- β Verify backup file is valid and complete (try extracting locally)
- β Try different restoration method (plugin restore, SSH, hosting restore)
- β Increase PHP memory limit to 512M+
- β Increase max_execution_time to 600+ seconds
- β Disable all plugins before restoring
- β Check database character set matches (utf8 vs utf8mb4)
- β Verify table prefix matches (wp_ vs custom prefix)
- β Check file permissions after extraction (755 for folders, 644 for files)
- β Run WordPress repair tool via wp-admin/maint/repair.php
- β Fix URLs with Search and Replace if needed
- β Enable debug logging to see actual errors
- β Try importing via SSH command line for large backups
- β Contact hosting if still failing
Prevention: Backups That Actually Restore
1. Test restore regularly
Create a test site and restore your latest backup to it every month. Don't wait until you need it to find out it's broken.
2. Keep multiple backup copies
Don't rely on one backup. Keep 3-4 recent backups. If one is corrupted, you have others.
3. Store backups off-site
Don't keep backups only on your hosting server. Download them to your computer and cloud storage (Google Drive, Dropbox, etc.).
4. Use reliable backup plugins
Established plugins (UpdraftPlus, BackWPup, Duplicator) handle large sites reliably. Cheap/free plugins often have issues.
5. Document your restore process
Write down exactly how to restore (which plugin, which settings, which method). When disaster strikes, you won't remember.
6. Keep SSH/FTP credentials accessible
If you need to restore via SSH and don't have credentials, you're stuck. Store them securely (password manager, not notebook).
When to Contact Hosting Support
Contact them if:
- You can't access FTP or SSH to do manual restore
- Database import fails even via SSH
- PHP limits won't increase
- You get "permission denied" errors during restore
- Automatic hosting backups are available and you want them restored
- You've tried all these steps and still can't restore
What to tell them:
"My WordPress backup won't restore. I've tried phpMyAdmin (times out), my backup plugin (fails), and SSH (won't connect). Can you help me restore from backup or provide your automatic backups?"
Most hosting can restore within 1-2 hours.
The Real Talk
Backup failures are terrifying because they threaten your last resort. When the site is broken and the backup won't restore, you feel completely helpless.
But here's what I've learned after restoring hundreds of backups: The backup is almost never the problem. The restoration process is almost always the problem.
Backups fail to restore because:
- Wrong tool for the job (phpMyAdmin can't handle size limits)
- Server limits too low (PHP memory, execution time)
- Configuration mismatch (table prefix, charset)
- Plugins interfering (security plugin blocking writes)
- Wrong permissions (files extracted with wrong perms)
These are all fixable. Work through them systematically.
And then, after you successfully restore, immediately set up automatic testing. Restore your backup monthly to a staging site. Know exactly what you'll do when disaster strikes.
A backup you haven't tested is just an expensive feeling of security.
A backup you've tested and restored is actual security.
Make your backups actual.
