As a senior CMS website operations manager for a cybersecurity company, I fully understand the importance of data security for any website, especially for single-page content that carries critical information.Under the AnQi CMS architecture, the content, layout, media files, and related configurations of a single page constitute an indispensable part of the website.Therefore, configuring a comprehensive backup and recovery strategy is the cornerstone for ensuring the continuous and stable operation of the website and for dealing with various risks (such as human errors, server failures, malicious attacks, etc.).

Although the Aiqi CMS mentioned 'Resource storage and backup management: provides resource storage configuration and system data backup and recovery to ensure data security' in the project advantages, the specific configuration method of its built-in tools is not detailed in the current document.Therefore, we will focus on building an effective backup and recovery strategy based on the core components (database and file system) relied upon by the Aanqi CMS, which will comprehensively cover your single-page data.

Understanding the data composition of a single page in Anqi CMS

Before delving into backup strategies, we first need to clarify how single-page data is stored in the AnQi CMS. As a content management system, the core information of a single page in AnQi CMS is typically stored in the following two main locations:

Database level:

Single page text content, SEO title, keywords, description, custom URL, display order, as well as the path of associated thumbnails, Banner images, and other metadata are all stored in the database.For example, the "About Us" or "Contact Us" page you create in the "Page Management" section of the background, all text and configuration options will be safely written to the database table.This means that a complete backup of the database is the key to restoring the core content of a single page.

File system level:

A single page may include or reference media resources such as images, videos, etc., which are typically stored in the server's file system and referenced by paths in the database. In addition, the system configuration files of the Anqi CMS (such asconfig.json)、Custom template files and other files required for system operation are also located in the file system.The backup of the file system ensures the integrity of these media resources and system configurations.

Therefore, a comprehensive single-page backup strategy must cover both the database and file system to ensure complete recovery in case of data loss.

Database backup strategy

It is recommended to use MySQL database when deploying AnQi CMS in Docker, therefore, the database backup will mainly focus on MySQL.

Regular full backup:

It is recommended to perform a full database backup at least once a day. For websites with frequent updates, consider increasing the backup frequency, such as every few hours. You can usemysqldumpUse a command-line tool to perform this operation, and automate it through a Cron Job (Linux) or Task Scheduler (Windows).

For example, on a Linux server, you can back up your MySQL database with the following command:

mysqldump -u [用户名] -p[密码] [数据库名] > /path/to/backup/anqicms_db_$(date +%Y%m%d%H%M%S).sql

Among them,[用户名]and[密码]are your MySQL database credentials, [数据库名]Is the database name used by AnQin CMS (for example, it may be when deployed in Docker)anqicmsordev_anqicms_com)/path/to/backup/Is the directory where you want to store backup files.

Incremental backup (optional):

For websites with massive data volumes and extremely frequent updates, in addition to full backups, consider implementing MySQL's binary log (binlog) for incremental backups, but this usually requires more professional database management knowledge.For most small and medium-sized enterprises and self-media, high-frequency full backup is sufficient to meet daily needs.

Backup file storage:

The backup files should be stored in a location different from the website server, such as professional cloud storage services (such as AWS S3, Aliyun OSS, etc.), another physical server, or a local backup device.This can prevent the backup files from being lost when the main server encounters a complete failure.At the same time, it is necessary to keep multiple historical backups to prevent the latest backup file from being corrupted or containing erroneous data.

File system backup strategy

The file system backup mainly targets the installation directory of Anqi CMS, especially the directories containing user uploaded content and custom configurations.

[en]Confirm backup range:

  • [en]Media files uploaded by the user:[en]This usually includes images, videos, attachments, etc. According to the template agreement of Anqi CMS, static resources may be located in/public/static/While user uploaded content may be/public/uploads/or other configured upload directories. Please make sure to verify your actual deployment path.
  • Template File: /templateall custom template files in the directory (.htmlFiles andconfig.jsonetc.).
  • System configuration file: config.jsonThe file is located in the root directory of AnQi CMS, containing port, database connection and other critical information.
  • AnQi CMS program files:Core execution fileanqicms(Linux) oranqicms.exe(Windows) and the related library files. Although these files can be re-downloaded from the official website, backing up a configured, running version can save recovery time.

Backup method:.

You can usetarPackage the entire SafeCMS directory command, or use.rsyncPerform incremental synchronization.

For example, the command to package the entire security CMS directory on a Linux server is as follows:

tar -czvf /path/to/backup/anqicms_files_$(date +%Y%m%d%H%M%S).tar.gz /www/wwwroot/anqicms.com/

Among them,/www/wwwroot/anqicms.com/This is your security CMS installation path. Please adjust it according to your actual situation.

Backup Frequency:

  • Regular backup:It is recommended to perform a full file system backup at least once a week.
  • Backup after changes:When you have uploaded a large number of new images, modified the website template, updated the system configuration files, or made other major adjustments, it is recommended to perform a file system backup immediately.

Backup file storage:

As with database backups, file system backups should also be stored offsite and retain multiple historical versions.

Recovery strategy

The value of backup lies in the ability to successfully recover. Therefore, you need clear recovery steps.

Database recovery:

  1. Stop the security CMS service:Ensure that the currently running Aqiyu CMS application is stopped before performing database recovery to prevent data conflicts or corruption.
  2. Delete the existing database (optional):If a complete recovery is needed, you can first delete the existing database and then rebuild it.
  3. Import backup file:UsemysqlCommand to import database backup file.
    
    mysql -u [用户名] -p[密码] [数据库名] < /path/to/backup/latest_backup.sql
    
  4. Start the Anqi CMS service.

File system recovery:

  1. Stop the security CMS service:Before restoring the files, the security CMS service must also be stopped.
  2. Replace file:Restore the backup file system directory (for example,/www/wwwroot/anqicms.com/) Extract or synchronize back to the corresponding location on the server, overwriting existing files.
  3. Start the Anqi CMS service.

Test the recovery process:

The most important point is that you must regularly (for example, every quarter) rehearse the entire recovery process in an independent test environment.This ensures that your backup files are complete and usable, and that you are familiar with the entire recovery process, avoiding confusion when you actually need it.

Summary

Frequently Asked Questions

Q1: Does the AnQi CMS have built-in backup functionality? Do I need to manually execute backups?

A1: According to the project advantages description of Anqi CMS, it 'provides resource storage configuration and system data backup and recovery, ensuring data security', which implies that the system has certain backup management capabilities.However, the specific operation interface or configuration method of its built-in backup function is not detailed in the existing documents.Therefore, as a website operator, we strongly recommend that you adopt the aforementioned external backup strategies at the database and file system levels as a supplement and reinforcement to ensure comprehensive data coverage and control over the data.Even if the system has built-in features, external backups provide an additional layer of protection in case of emergencies.

Q2: I only care about my 'About Us' page content, do I need to backup the entire website?

A2: Yes, you need to backup the entire website.In AnQi CMS, the core data such as text content on a single page, SEO settings, etc., are stored in the database, while the media files such as images, videos, etc., displayed on the page are stored in the file system.Therefore, it is not realistic to back up a single "single-page" because its data is dispersed in the database and file system.A complete database backup and filesystem backup are necessary to ensure that your 'About Us' page and all related content (including images) can be fully restored.

Q3: Where should the backup files be stored? How long should they be kept?

A3: Backup files should always be stored on a remote storage medium that is physically different from your website server, such as cloud storage services (such as AWS S3, Google Cloud Storage), another independent server, or even an encrypted external hard drive.This can prevent the loss of both the website and the backup simultaneously due to a single point of failure (such as the destruction of a server or a data center interruption).As for how long to save, it depends on your business needs and compliance requirements.Generally, it is recommended to keep at least 7 days of daily backups, 3-4 weeks of weekly backups, and some monthly or quarterly backups at key points in time.Regularly cleaning up expired backups is necessary, but also ensure that there are enough rollback points available at any time for recovery.