What should be done before upgrading to the new version?
What to do before upgrading to the new version? Three things: a recoverable backup, a clear rollback path, and a credential rotation after the upgrade. Many sites treat the upgrade as 'clicking update', and only find out that the backup can only restore the database, and the static files are not saved together. When rolling back, the template and data version do not match. If the sequence is correct, the upgrade itself is very fast.
What backup to leave before the upgrade
Ensure that the backup covers all the necessary content to recover: database data and uploaded static files (images, attachments, generated cache pages) together. Websites that only back up the database will appear with 'Data is back, image 404' after rollback. After the backup is completed, perform a recovery drill - restore this backup on another machine or another set of environments to see if the backend can be opened. Unverified backups are equivalent to no backups.
Simultaneously record the current version number and database structure version, AnQiCMS current version is v3.6.6, released on October 8, 2026. If the site has not been updated for a long time, first confirm which version you are on, then decide whether to upgrade in one step or do it step by step, it is easier to locate problems when upgrading across many versions.
Why should security fixes be grouped together
Some version updates are not just changes in functionality. v3.6.6 fixes two high-risk issues: the first is a SQL injection in the list sorting parameter, where the order sorting parameter passed from the template and interface originally only checked the first and last characters, which could be constructed into time-based blind injection, dragging out database content character by character, including the administrator password hash. The fix is to change to a strict identifier whitelist, which only accepts column names, table names dot column names, and ascending/descending order markers, and discards the rest and falls back to the default sorting;The password hash is used as the login key for multi-site switching login, the random string can be repeatedly generated, the ticket never expires, once the hash is leaked, it is equivalent to long-term password-free login, after the fix, it is changed to a one-time ticket issued by the server, the key is changed to the site's own signature key, valid for 120 seconds and失效 after one use.
The key point here is that the attacker may have already obtained the database content and login sessions. Therefore, the official upgrade prompt explicitly stated that simply upgrading is not enough to clear the sessions obtained by the attacker, and it is necessary to rotate the signature keys of all sites and change all administrator passwords after the upgrade, and only after completing these two steps with a comma can it be considered closed.
The order of the upgrade window
First select the off-peak period, then display the maintenance reminder, and then proceed in the order of 'backup, stop writing, upgrade, verify, and restore access'. This step of stopping writing is particularly useful for sites with a large amount of content, to avoid new data generated during the upgrade process falling into the old structure.The deployment method affects the rollback path: for Docker image deployment, the rollback involves cutting the image tag back to the previous version, without affecting the data volume; for one-click deployment on panels like Baota Panel, the rollback requires using the panel's version rollback or directly restoring from a backup, and confirm that the old version package can be retrieved from the panel before upgrading.The system listens on port 8001 by default, providing access from the reverse proxy. After the upgrade, if you encounter issues such as 'The background can be opened, but the front-end style is messy', first check if the proxy configuration has been reset.
Keep the terminal session and log output during the upgrade, so that you can immediately see which step fails when an error occurs, which is faster than looking through the logs later. For sites with large amounts of data, the structure change script may take a long time, so do not do this during off-peak hours.
The checklist after the upgrade
Check in order: Can the backend log in, has the administrator password been changed, and has the signature key been rotated? Is the front page, list page, and detail page rendering normally? Are the static rules and sitemap still the same as before the upgrade? Can forms and messages be submitted? Are the API calls still returning the same fields? After that, confirm that the backup task is re-enabled - the automatic backup that was paused for convenience during the upgrade is the easiest to forget to turn on. If the site has been hacked, in addition to rotating the keys and changing the password, you also need to check if hidden scripts have been written into the administrator account list and templates.
Common questions
Can we not upgrade the minor version?Versions with security fixes should not be skipped. Functional minor versions can be delayed, security versions should be done as soon as possible, the judgment basis is the fixes in the update description rather than the size of the version number.
Should content be exported before upgrading?It is recommended to export a parseable backup, such as a compressed package or a batch import file in table form, in case the structure changes and there is a problem, it can still be read by another system.
Will data be lost after rollback?The new content added during the upgrade may not be readable back due to inconsistent structure. This is why it is required to stop writing and use the same backup to restore data and static files after rollback.
How often should a recovery drill be done?At least once every quarter, an additional one before a major version upgrade. The focus of the drill is the time from backup to accessibility, not the existence of the backup file.