You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何恢复WordPress备份?升级后数据丢失,如何回滚至旧版本?

Hey there, I’ve dealt with this exact WordPress rollback headache a few times, so let’s walk through this step by step to get your site back to its pre-upgrade state.

1. First, Diagnose Why cPanel Backup Restore Failed

Before jumping into manual recovery, let’s figure out why the automated restore didn’t work—this prevents repeat issues:

  • Check backup integrity: Download your cPanel full backup to your local machine, then try extracting it with a tool like 7-Zip or WinRAR. If you get corruption errors, the backup itself was broken (maybe a partial backup due to server timeouts). Check if cPanel has older backups available.
  • Verify server disk space: Head to cPanel’s Disk Usage tool—if your server is low on space, the restore process will fail mid-way. Clear unused files or upgrade your plan if needed.
  • Check file permissions: Sometimes incorrect permissions on your public_html folder block the restore. In cPanel’s File Manager, right-click public_html and set permissions to 755 (folders) and 644 for files.
2. Manual Recovery of cPanel Backup (Since Automated Failed)

cPanel’s automated restore can be finicky, so manual recovery is more reliable. Split this into two parts: files and database.

2.1 Restore Website Files

  • First, safeguard your current (broken) site: In cPanel File Manager, navigate to public_html, select all files/folders, click Compress to create a backup zip—this lets you revert if something goes wrong.
  • Delete all existing files in public_html (keep the zip backup you just created, though).
  • Download your cPanel full backup locally, extract it, and locate the public_html folder inside the backup.
  • Upload all contents of this backup’s public_html to your server’s public_html directory. Use FTP (like FileZilla) for large files—it’s more stable than cPanel’s built-in uploader.
  • After uploading, double-check permissions: Set folders to 755, files to 644, and wp-config.php to 600 for extra security.

2.2 Restore Database

  • Log into cPanel’s phpMyAdmin tool.
  • Locate your WordPress database (you can find its name in wp-config.php under the DB_NAME variable).
  • Backup the current broken database: Select the database, click Export to save a copy locally—just in case.
  • Delete all tables in the current database, or delete the database entirely and create a new one with the same name (make sure the database user has full privileges, which you can check in cPanel’s MySQL Databases tool).
  • From your extracted cPanel backup, find the database backup file (usually a .sql or .sql.gz file in the mysql folder, named after your database).
  • In phpMyAdmin, select the empty database, click Import, choose the backup file, and click Go. Wait for the import to finish (large databases may take a few minutes).
  • Confirm wp-config.php has the correct database credentials (DB_NAME, DB_USER, DB_PASSWORD, DB_HOST)—match these to the ones in cPanel’s MySQL Databases tool.
3. Roll Back to the Old WordPress Version

If your restored backup already includes the pre-upgrade WordPress core, you’re done here. But if you accidentally re-upgraded after restoring, follow these steps:

  • Download the exact WordPress version you had before the failed upgrade from the official WordPress old version archive (access this via WordPress’s official resources).
  • Extract the zip file locally, then delete the wp-content folder inside the extracted files—this avoids overwriting your restored themes, plugins, and media.
  • Upload the remaining files/folders (wp-admin, wp-includes, and all root .php files except wp-config.php) to your server’s public_html directory, overwriting the existing files.
  • Log into your WordPress admin dashboard, confirm the version is correct, then disable all plugins and re-enable them one by one to catch any compatibility issues with the old core version.
4. Prevent This From Happening Again
  • Double backup before upgrades: Always take both a cPanel full backup AND a WordPress-specific backup (using a plugin like UpdraftPlus) before touching core versions.
  • Test upgrades in a staging environment: Most hosting providers offer staging sites—clone your live site there, test the upgrade, and fix any issues before applying to production.
  • Disable plugins pre-upgrade: Plugins are the #1 cause of upgrade failures. Disable all plugins, run the upgrade, then re-enable them one by one.

内容的提问来源于stack exchange,提问作者Manar S. Bedor

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 09:32:15