Knowledge Base
Why didn't CodeGuard Automated Test Restore work?
Overview
By the end of this article you will understand why an automated test restore, the routine check in which CodeGuard writes a small test file to your website and confirms it can be viewed, may report a failure, and you will be able to confirm for yourself that CodeGuard can restore your content.
A failed automated test restore does not mean your backups are unusable. It means this specific automated check could not complete on this website.
The article covers three causes of failure:
- The website root directory could not be located.
- The test file could not be displayed in a browser.
- The server connection failed.
It then gives a manual restore test you can run to verify restore capability directly, followed by how to confirm the result.
What an automated test restore does
CodeGuard periodically places a small test file in the root directory of your website and then attempts to load that file in a browser. If the file can be written and displayed, CodeGuard can both write to your server and place content where your website serves it, the two capabilities a real restore depends on. CodeGuard removes the test file afterwards.
The automated test is a convenience check. A failure indicates the check could not run on your website configuration, not that your backup data is affected or that a real restore would fail.
Causes of a failed automated test restore
The website root directory could not be located
CodeGuard writes the test file to the root directory of your File Transfer Protocol (FTP) or Secure File Transfer Protocol (SFTP) account. On many hosting setups the website root is a subdirectory of that account, commonly public_html or www, rather than the account root itself. When the two differ, the test file is written somewhere your website does not serve.
What to do: Confirm which directory your website is served from by signing in with an FTP or SFTP client and locating your site's home page file. If it is not in the account root, the mismatch explains the failure. Your backups are unaffected.
The test file could not be displayed in a browser
The file was written successfully, but CodeGuard could not load it over the web. Server rules can prevent this, for example, a configuration that blocks static HTML files in that location, a redirect that rewrites the request, or access rules that return an error to unrecognised requests.
What to do: No action is required for your backups to work. If you want to confirm restore capability, run the manual test below, which does not depend on the file being viewable in a browser.
CodeGuard could not connect to your server
The connection to your server failed at the time the test ran. Causes include changed credentials, a hosting provider blocking CodeGuard's connections, or a temporary outage.
What to do: Check whether your recent backups are completing successfully in your dashboard. If they are not, the connection issue affects backups as well as the test, and should be resolved first.
Manually test CodeGuard's restore capability
This procedure restores a real file from a real backup, so completing it without errors confirms CodeGuard can restore your content.
Before you begin
- An FTP or SFTP client, such as FileZilla or Cyberduck.
- The credentials for the FTP or SFTP account that hosts your website.
- Knowledge of which directory your website is served from.
- A small test file. Any plain HTML file will do. It does not need to contain anything meaningful. Give it a distinctive name, such as
codeguard-restore-test.html, so you can find it easily in later steps.
Steps
- Upload the test file. Using your FTP or SFTP client, upload the test file to the root directory of your website.
- Take a backup. In CodeGuard, open the Files page for the website and select Run Backup Now. Wait for the backup to finish.
- Confirm the file was captured. When the backup completes, check that your test file appears in the list of files added in that backup.
- Delete the test file from your server. Using your FTP or SFTP client, remove the test file from the website root. This is what the restore will undo.
- Restore the file. In CodeGuard, open the Restore page and select Restore Options beside the backup you just took. In the Individual File Restore section at the bottom of the page, type the name of your test file. When it appears in the list, select it, then select Restore Selected.
- Verify the file returned. Using your FTP or SFTP client, sign in to your server and confirm the test file is present in the website root again.
Confirm the result
The test succeeded if the file is present in the website root in step 6 and its contents match the file you uploaded in step 1. That result confirms CodeGuard can retrieve content from a backup and write it to your server, which is what a real restore does.
If the file did not return, or an error appeared at any step, contact Sectigo support with the website name and the step at which the problem occurred.
Once you are satisfied with the result, delete the test file from your server.
Similar questions
- My CodeGuard test restore failed — are my backups still safe?
- How do I know CodeGuard can actually restore my website?
- Why does CodeGuard say my website is not compatible with test restore?
- How do I restore a single file from a CodeGuard backup?
Related articles
| Article | Live URL |
|---|---|
| An In-Depth Look at How CodeGuard Works | https://www.sectigo.com/knowledge-base/detail/An-In-Depth-Look-at-How-CodeGuard-Works |
| How do I switch servers for a site that's already backed up on CodeGuard | https://www.sectigo.com/knowledge-base/detail/How-do-I-switch-servers-for-a-site-that-s-already-backed-up-on-CodeGuard |
| Why can't CodeGuard connect to my SFTP/FTP server? | https://www.sectigo.com/knowledge-base/detail/Why-can-t-CodeGuard-connect-to-my-SFTP-FTP-server |
| How to manually add your Bluehost database to CodeGuard | https://www.sectigo.com/knowledge-base/detail/How-to-manually-add-your-Bluehost-database-to-CodeGuard |
| Can I download a zip file directly to my server? | https://www.sectigo.com/knowledge-base/detail/Can-I-download-a-zip-file-directly-to-my-server |
| What kind of files does CodeGuard exclude from backups? | https://www.sectigo.com/knowledge-base/detail/What-kind-of-files-does-CodeGuard-exclude-from-backups |
| Database Backup through SSH Tunneling - WebHostingBuzz Example | https://www.sectigo.com/knowledge-base/detail/Database-Backup-through-SSH-Tunneling-WebHostingBuzz-Example |
Need assistance?
Contact our team for help with your purchase or issuing your certificate.