This tutorial is in two parts. How to create a backup in PHPFox and how to restore the backup
How to Create a Backup of your PHPFox
It is always considered as a good practice to generate backups of your website on a regular basis. However, it is a MUST to create such when performing changes on your website. This way, if something goes wrong with your website, you will have a working point that you can restore immediately and get it up and running again.
To create a backup of your PHPFox website, you need to:
- Step 1: Backup Files
- Step 2: Backup Database
The first step of the process is to generate a backup of your PHPFox files. To complete that, first locate the directory, where you have installed PHPFox. This is usually the public_html/ directory of your account, but this location can be different if you are accessing your website via a subdomain or subfolder.
There are two ways of downloading your files to the server - using an FTP client, following our FTP tutorial, or downloading them directly through your cPanel account > File Manager, following our cPanel tutorial.
To create a backup of the MySQL database used on your PHPFox website, you need to log into your cPanel account, locate the Database section and click on the phpMyAdmin service.
Click on the name of the database set on your website.
PHPFox configuration file.
If you are not aware of the database name on your PHPFox installation, you can check that information by reviewing our tutorial on how to locate the main PHPFox configuration file.
Click on the Export button at the top menu.
Click on the Go button.
How to Restore a Backup of your PHPFox
To restore a PHPFox backup of your website, you basically need two things – the files of the PHPFox installation and the database that you were using for it.
To restore a PHPFox backup, you need to:
- Step 1: Restore Files
- Step 2: Restore Database
- Step 3: Link files and database
Step 1: Restore files
You need to restore the backup of your PHPFox files to the exact location, where you wish to restore it. This can be achieved with the use of your favorite FTP client or directly via the File Manager service within your cPanel account. Choose carefully the directory, where you would like your PHPFox website to appear and make sure that you remove any previous contents located there.
Step 2: Restore database
It is important to have an empty database that will be used to restore the backup of the one you were using.
You can create a new database and a user assigned to it via cPanel. Simply follow our MySQL Wizard tutorial for information on that.
Then, you need to log into your cPanel account. Locate the Database section and then click on the phpMyAdmin feature.
Select the newly created database.
Click on the Import button at the top menu.
Select the backup dump file from your personal computer and then click on the Go button to import it.
Step 3 Link files and database
By completing both of the steps above, you will have a location on your account, which contains all of the files and folders of your PHPFox website. You will also have a database, which contains the backup of your PHPFox database. Now, it is time to configure them both together.
PHPFox configuration file.
To locate the name of your database, you can review the main PHPFox configuration file.
You can edit the file and enter the details for your new database, user and password, using your favorite FTP client or directly via the File Manager service within your cPanel account.
Why is a Database Backup Necessary
1. Guard Against Human Error
Everyone makes mistakes from time to time. You might delete an important file on your website, make a change that breaks some of its functionality, and so on. There are ways to fix these kinds of errors, but in our experience, few are as efficient as restoring a previous backup.
To put this into perspective, imagine that a significant part of your website ceases to work. You have two options:
- Identify the problem and look for a way to solve it.
- Restore your website’s most recent backup and move on.
The first method can be quick or take a lot of time, depending on how serious the problem is. However, with the second approach, you can have your site up and running quickly. All you need is a recent enough backup that you won’t lose any valuable data.
The primary takeaway is that backups can save you in situations where you or someone else makes a mistake on your site. To be as safe as possible, you’ll want to create those backups frequently — even on a daily basis.
2. Reverse Problems During Updates
Updates are necessary to keep your site functioning smoothly. At the same time, it’s not uncommon to perform an update to your site, only to see something unexpectedly go wrong. That doesn’t mean you shouldn’t make changes — you just have to go about them safely.
Ideally, you’ll have an automatic backup system set up for your site. That way, if you update any of its key components, you’ll have a recent restore point available just in case. It’s also smart to make a manual backup before you start tinkering with your website.
It might take you a few minutes or longer to get that backup ready. However, you’ll be happy you made the time if anything goes wrong during the update process.
3. Prevent Data Loss
Imagine that you have a blog with hundreds of posts, and someone on your team deletes one (or more) of them by mistake. In the past, we’ve seen people delete entire libraries of content because they didn’t know what they were doing or they gave certain users too many privileges.
One of the primary reasons to maintain a backup system is to ensure that your data will be safe, even in situations like this. That means you need to have a full backup of your site in place, and the same goes for your personal data as well.
Data loss can occur even if there’s no human error involved. That means having backups is essential, even if you and your team know what you’re doing.
If you’re worried about losing important data, we recommend you take things one step further. Not only should you have multiple backups available, but you should also avoid keeping them all stored in the same location. We recommend downloading your latest backups to a safe hard drive or to the cloud, as well as keeping a copy on your server for redundancy’s sake.
4. Handle Compatibility Issues After New Installations
If you use WordPress or any other Content Management System (CMS), then you probably rely a lot on add-ons, such as themes and plugins. Both types of tools can be incredibly handy. However, each time you install a new add-on, you’re introducing an element that might not play nicely with the rest of the site’s ecosystem.
Just as with updates, this doesn’t mean you should avoid plugins and themes. Instead, what you need to do is be careful about the ones you install. Make sure they have good reviews and ratings, and that the developers update them frequently.
You’ll also want to back up your website before you activate a new theme or WordPress plugin, just to be safe. With this approach, if a compatibility issue pops up, all you have to do is revert to a previous backup. Then, you’re free to install an alternative tool.
5. Resolve Malware Infections
A lot of people think of malware as something that can only affect personal computers. However, a surprising number of websites are infected with some kind of malware, and a lot more of them are vulnerable to it.
Even if you’re proactive about website security, attackers have highly-sophisticated techniques in their arsenals. Also, keep in mind that not even smaller, lesser-known websites are safe from attacks. WordPress users, for example, often face threats from bots looking for vulnerabilities they can exploit.
Troubleshooting malware can be particularly tricky since it’s hard to know when your site is fully clean. Even then, if you don’t identify and patch the security ‘hole’ that led to the infection, you’ll remain vulnerable. Having a backup ready to go will help you get your website clean faster.
6. Provide Protection Against Hackers
There may also be times when attackers try to access your site directly to deface it or steal important information. If someone manages to breach an account with administrative privileges, for example, they might change its credentials to lock you out of your site.
This shouldn’t happen if you take the right security precautions. It’s especially critical to have Two-Factor Authentication (2FA) enabled on your site. If there is a hack, however, there are three ways you can proceed:
- Try to recover access to your account through your email.
- Contact your web hosting provider to ask for their assistance.
- Restore a backup from your hosting panel.
The first option might not always work since attackers will probably change the email associated with the account right away. If you’re using a reputable web host, the company should be able to help you — but that can take time.
Restoring a backup, on the other hand, can help you regain control of your site quickly. Once you do, you can update your credentials to ensure that attackers are locked out once more.
7. Simplify the Process of Migrating Web Hosts
In a perfect world, you wouldn’t need to switch web hosts. However, a lot of people make the mistake of choosing the first provider they run into that looks decent. It does not always end up so good
This means you may need to migrate from one web host to another at some point. The process involves moving all of your site’s files from one server to another. The good news is that if you’ve taken our advice to heart, you already have multiple full copies of your website ready to go.
There are a lot of ways you can use backups to migrate your website. You can copy files manually, use dedicated tools, or ask your new provider to do it for you. In any case, having a backup ready means that you can switch web hosts at a moment’s notice if you need to, which gives you a lot of freedom.
8. Make It Easy to Create a Testing Version of Your Website
Whenever you want to make a significant change to your site, the safest way to do so is by using a testing environment. That way, if something goes wrong during or after the update, you can keep it from affecting your live website.
To do this, you’ll need what’s called a staging site. There are several ways you can go about creating one, and they’re all pretty straightforward. What’s more, having a recent backup of your site in place means you can be ready to set up a staging copy in minutes.
9. Ensure an Uninterrupted Revenue Stream
If you make money from your website, then you need to ensure that it’s always accessible. Every minute that it isn’t working can cost you money. Just to give you an idea of the stakes, Amazon estimated that a little downtime during its Prime Day event cost it anywhere between $72–$99 million.
If you run a small business, you’re probably not working with those kinds of numbers. However, that means it’s even more important not to lose out on any potential earnings due to problems with your website. An hour’s (or a day’s!) lost income can be a significant blow to any business.
Troubleshooting unexpected problems from scratch can take a lot of time, as we mentioned before. On the other hand, if you can restore a backup, you’ll get your website back online and earning money quickly. Then you can take your time to find out what went wrong in the first place and keep it from happening again.
10. Foster Strong Security Practices
If we had a dollar for every time we recommended that website owners back up their data, we’d be millionaires. However, if you took a dollar away for every time someone ignored that advice, we might break even.
The fact is that backups are about as versatile as sliced bread. Plus, you have so many options for how to back up your site that there’s no excuse not to do it. Backing up your data, in general, is the cornerstone of good digital security.
If you take your website seriously, you’ll also want to read up on the other best security practices you can implement. However, the first step is to create a backup right away and repeat the process often. Sooner or later, it will save your site so now’s the perfect moment to start.