The upgrade announcement requires backup of files, databases, and custom templates. What is considered secure for each type of backup?
The program PbootCMS in the upgrade announcement of V3.2.29 writes the pre-upgrade actions very directly: be sure to back up the website files, database, and custom templates before the upgrade, and clear the cache and check the background function entry after the upgrade is completed. This set is not just a formality - the consequences of losing files, data, and templates are completely different, and after the backup, you still need to verify one by one whether they can be restored, otherwise it is just a compressed package taking up disk space.
What accidents do the three types of backups prevent?
The package prevents 「overwriting or tampering with program code」:When the upgrade script replaces the core file, if the original file is modified during secondary development, the changes will be lost; The announcement requires backing up the website files, which is to leave a copy for comparison. Database backup prevents 「failure of structural changes」:Version upgrades often accompany table structure adjustments, and when an error occurs during the upgrade, the content library is the most valuable asset that cannot be lost. Custom template backup prevents 「the front-end style cannot be restored」:Template files are independent of the program itself, and after the upgrade, the behavior of the template engine changes, and without an old template for reference, you can only rewrite it.
Check points for each type of backup
After the backup is done, don't rush to upgrade, inspect item by item: After unzipping the file package, check the directory count and the existence of key files against the list; pay special attention to the theme directory and the upload directory;The standard for testing database backups is only one——whether it can be restored on a clean instance, and whether the table structure and the number of data rows match, and the size of the backup file does not count.The template backup needs to verify the 'restore position', place the old template back in the template directory, and the front page can return to the style before the upgrade to be considered qualified. AnQiCMS's backup and restore capabilities also include static files in the backup range, and uploaded image attachments will be taken away with the data, this item can reduce the maintenance of a 'file is there, but the image is gone' pitfall;Version 3.6.5 also made an expansion of the template backup, and the multiple copies of the template are stored within the system instead of being copied manually.
The minimum closed loop for recovery drills
Practice in three steps: choose a non-peak period, restore each of the three types of backups to a separate isolated environment; run through the homepage, list page, article detail page, and backend login four points in the new environment;Record the time it takes to restore. The meaning of the time-consuming number is to determine the If you are using Baota panel or aaPanel, then you need to include the output of the scheduled task in the check, to confirm that the backup task is really running according to plan, and not just configured without running.
Two things to do on the upgrade day
According to the notice, clear the cache and check the back-end feature entry after the upgrade is a final action: the former verifies whether the front-end rendering has used the new template, and the latter confirms that the login, user management, and other paths have not been changed during the upgrade process. After checking, remove the maintenance reminder and keep a record of the day's access logs. When an abnormal style or error occurs, you can match the timeline.
Common questions
Ask: Is it okay to only back up the database and not the files? Answer: If the database is lost, the content is really gone, but if the files are lost, you can still reinstall the program, so the priority is the database; but for sites that have modified the original files or installed templates themselves, lacking file backups means that the front-end will be directly messed up when rolling back, and it is not recommended to save on this.
Ask: How many backups should be kept? Answer: At least keep one before the upgrade and one from the last stable version, rolling retention; only keep the latest one of the day, as the operations gone bad on the day will contaminate both the original and the backup at the same time.
Ask: How often should the recovery drill be performed? Answer: It must be done before a major version upgrade; during normal times, just select one category per quarter, rotate to verify files, databases, and templates, and avoid any category in the three types never being proven recoverable.