Restoring website files and a database manually
Put back individual files, folders or a database from a backup without overwriting your whole account.
On this page
Often you only need part of a backup: one deleted folder, or yesterday’s database.
Restoring files
- On your computer, open the backup archive and find the files you need. - In a DirectAdmin backup, website files are under a
domains/yourdomain.co.uk/public_htmlpath inside the archive. - Compress just those files or folders into a zip.
- Upload the zip to the right folder and extract it, allowing it to overwrite. How to upload and extract a zip file
- Delete the zip.
Restoring a database
- Find the database file in the backup (a
.sqlor compressed.sql.gzfile, named after the database). - Export the current database first, in case you need anything from it. How to export a database (backup with phpMyAdmin)
- In phpMyAdmin, select the database, select all tables and drop them — or import into a new empty database and switch the application’s configuration to it, which is safer.
- Import the backup file. How to import a database with phpMyAdmin
Matching files and database
For applications like WordPress, restore files and database from the same backup. Mixing a new database with old plugin files, or the reverse, can break the site.
After restoring
- Clear any page cache
- Reset permalinks in WordPress (Settings → Permalinks → Save)
- Test logins and forms
Prefer to follow along?
- Back up WordPress and prove you can restore it
Intermediate · 45 min - Recover a hacked website
Advanced · 120 min
If it doesn’t work
These guides cover the most common problems, starting with what you can see. Or browse every fix for a common problem.
- Database connection failedFix ‘Access denied for user’, ‘Unknown database’ and connection errors in PHP apps by checking prefixes, passwords, privileges and host.
- “Permission denied” and files that won’t save or uploadFix uploads and saves failing with permission errors in WordPress, apps and FTP, without resorting to unsafe 777 permissions.
- 500 Internal Server Error: how to fix itFind the real cause of a 500 error: read the error log, then check .htaccess, PHP errors, permissions and PHP version in order.
Spotted something out of date or unclear? Tell us and we’ll fix it.