Backing up your WordPress site is a critical task to ensure your data's safety and availability in case of unforeseen events. Following the 3-2-1 backup rule is a reliable strategy: keep three copies of your data, store them on two different media, and save one copy offsite. This guide will walk you through the process of backing up and restoring your WordPress site using cPanel and the UpdraftPlus plugin.
In this guide
What to back up
When backing up your WordPress site, it's essential to ensure that you back up both the files and the database. The files, typically located in the public_html directory, include your WordPress core files, themes, plugins, and uploads. These files are crucial for the visual and functional aspects of your site. Equally important is the database, which contains all your posts, comments, and settings. Without a database backup, you risk losing all your site content and configurations. Failing to back up either component can lead to incomplete restoration and potential data loss.
To effectively back up your site, start by identifying all the critical components. The wp-content folder is particularly important as it houses your themes, plugins, and media uploads. Regularly updating your backup to include recent changes is crucial, especially if you frequently update your site with new content or design changes. Additionally, consider backing up your .htaccess file and wp-config.php file, as these contain important configurations and settings that help your site run smoothly. By ensuring these elements are included in your backup, you enhance your ability to restore your site to its original state in the event of data loss.
cPanel backup
cPanel provides a built-in backup tool that allows you to create full or partial backups of your site. A full backup includes all files, databases, email accounts, and settings, while a partial backup lets you select specific components, such as home directory files or individual databases. To begin, log in to your cPanel account via the server hostname provided in your welcome email, using port 2083. Navigate to the 'Backup' section and choose whether you want a full or partial backup. Once selected, the system will generate the backup file, which you can download to your local computer for safekeeping. Remember to store a copy offsite as part of the 3-2-1 rule.
When creating a full backup in cPanel, it is essential to understand the difference between full and partial backups. A full backup is comprehensive and includes all account information, but cannot be restored via the cPanel interface. It is typically used for account transfers or migrations. Partial backups, on the other hand, allow you to restore specific elements like databases or home directories directly through cPanel. To perform a partial backup, navigate to the 'Backup Wizard' in cPanel and select the specific components you wish to back up. After downloading your backup files, verify the integrity of the backup by checking file sizes and ensuring no errors occurred during the process. This verification step is crucial to avoid issues during restoration.
UpdraftPlus plugin
For a more automated backup solution, consider using the UpdraftPlus plugin. First, install and activate the plugin from the WordPress plugin repository. Once activated, navigate to Settings > UpdraftPlus Backups in your WordPress dashboard. Configure the backup schedule according to your needs; daily or weekly backups are recommended depending on how frequently you update your site. UpdraftPlus supports remote storage options like Google Drive and Dropbox, allowing you to store backups offsite. Connect your preferred storage service within the plugin settings. After configuration, initiate your first manual backup by clicking the 'Backup Now' button. This ensures you have an immediate backup to restore from if needed.
UpdraftPlus offers various advanced features that enhance the backup process. For instance, you can set up automatic backups before making significant changes to your site, such as updating themes or plugins. This pre-update backup ensures you can quickly revert to a previous version if something goes wrong. Additionally, UpdraftPlus allows you to encrypt your database backups, adding an extra layer of security to your sensitive data. To optimise storage space, consider enabling the option to delete old backups automatically. This feature helps manage your storage usage effectively, especially if you have limited space on your remote storage service. By leveraging these features, you can create a robust backup strategy that safeguards your site against data loss.
Restoring from backup
Restoring your WordPress site can be done using either UpdraftPlus or cPanel. To restore from UpdraftPlus, go to the plugin's settings and select the components you wish to restore, such as files, database, or both. Follow the on-screen instructions to complete the restoration process. For cPanel, if you need a full site restoration, you might need to submit a support ticket through our support portal. For partial restorations, such as individual databases or files, you can download the necessary backup files from cPanel and manually upload them to your server using the cPanel File Manager or an FTP client.
When restoring with UpdraftPlus, ensure you deactivate plugins that may interfere with the restoration process. This step can prevent conflicts that might arise from outdated or incompatible plugins. After restoring your site, thoroughly test its functionality by checking pages, posts, and any custom features to ensure everything works as expected. For cPanel restorations, pay attention to file permissions and ownership settings, as incorrect configurations can lead to errors or inaccessible files. If you encounter issues during restoration, consult your hosting provider's support team for assistance. They can provide guidance on resolving common restoration problems, ensuring your site is up and running smoothly.
Troubleshooting
Several issues can arise during the backup and restoration process. If you encounter a timeout error, consider increasing the server timeout settings or breaking the backup into smaller parts. If remote storage fails, ensure that your storage service credentials are correct and that there is sufficient space available. After restoring a site, it might display errors; this could be due to missing files or database discrepancies. Double-check that all necessary components were restored and consider enabling WordPress debugging to identify the source of the errors.
Another common issue is encountering corrupted backup files, which can occur due to incomplete uploads or downloads. To mitigate this risk, always verify the integrity of your backup files by checking their sizes and running checksum tests. If you experience issues with UpdraftPlus not recognising remote storage, re-authenticate the connection and ensure that API permissions are correctly set. In cases where your site does not display correctly after restoration, clear your browser cache and any caching plugins to rule out cached content issues. By addressing these troubleshooting steps, you can resolve most backup and restoration challenges efficiently.
Related guides
- How to Install WordPress on GHost Cloud
- How to Secure Your WordPress Site
- WordPress Troubleshooting - Common Errors and Fixes
- cPanel Overview - A Complete Beginner's Guide
- How to Manage Files Using cPanel File Manager
For more details, refer to UpdraftPlus.
For additional protection, consider using our CodeGuard Backup service to automate your backup processes and ensure your WordPress site is always recoverable.
