Colleagues, as a long-term front-line website operation personnel in AnQiCMS, I deeply understand the importance of the stability and efficiency of the content management system for business development.Recently, many operation partners have been consulting about upgrading AnQiCMS from version 2.x to 3.x, especially the recommended solution for multi-site data migration.Today, I will combine our practical experience with the latest documentation of AnQiCMS to give you a detailed explanation of this process, ensuring a smooth transition for your multi-site setup.

AnQiCMS 3.x version has been significantly optimized in terms of architecture and functionality, especially in the ease of deployment and multi-site management, achieving a qualitative leap.Compared to the more complex independent deployment mode of version 2.x, version 3.x has greatly reduced the operation and maintenance costs through Go project management and a unified multi-site background, improving the overall security and operational efficiency.Therefore, this upgrade is not just a version iteration, but also an optimization of your content management strategy.

Upgrade the main AnQiCMS instance

The first step in upgrading multi-site is to handle the AnQiCMS main instance that you are currently deploying. This main instance is usually the first one you installed or the site that you have multi-site management permissions for.

First, please log in to the backend management interface of this main site.In the background system upgrade feature, upgrade the AnQiCMS program to the latest 3.x version.After completing the program upgrade, since the 2.x version usually depends on scheduled tasks to maintain operation, you need to use the original scheduled task script (such asstart.shPerform a restart operation to ensure the program starts normally after the upgrade.If the background version information does not update in time after the restart, please try clearing the system cache or check the log files for troubleshooting.

Next, we will convert this main instance to the recommended 'Go project' deployment mode for version 3.x.You need to stop and delete the scheduled task corresponding to the 2.x version.Then, follow the AnQiCMS 3.x installation guide, add this AnQiCMS instance as a Go project in your server management panel (such as Baota panel).When configuring the Go project, be sure to select the directory pointing to your existing AnQiCMS installation.anqicmsAn executable file, and use the port that your current site is listening to (usually 8001).In this way, the newly deployed 3.x version will directly inherit the configuration and data of your existing site without the need to reinstall it.

Integrate the existing child sites into the 3.x multi-site management system

After completing the upgrade and deployment mode conversion of the main AnQiCMS instance, we can then proceed to handle the remaining 2.x version sub-sites.In the 3.x version, all child sites will be managed by the same AnQiCMS instance, which greatly simplifies the multi-site architecture.

For each existing 2.x sub-site, you first need to stop and delete the corresponding scheduled task.Then, log in to the backend of the 3.x main AnQiCMS instance you have upgraded, go to the "Multi-site Management" feature, and click "Add New Site."}

This is a critical step in the data migration process when adding a new site. Please fill in the information carefully:

  • Site name: Name it according to the actual use of the sub-site, which is convenient for you to distinguish in the background.
  • Site root directory: Here you need to fill in the physical root directory path of the existing 2.x sub-site. For example, if the original site files are in/www/wwwroot/sub.anqicms.com/, you should fill in/www/wwwroot/sub.anqicms.comso that the new site can recognize and use the old static resources and file structure.
  • website address: Please fill in the domain name of your sub-site, make sure the domain has been resolved and bound to the server.
  • Administrator account and password: Set up independent backend administration account and password for new site.
  • Database namePlease enter the database name used by the existing 2.x sub-site.
  • Duplicate database informationIf you previously had 2.x child sites and the main instance sharing the same database account, you can choose to reuse it. If the database account is independent, please fill it in truthfully.

The key is that by specifying the original root directory and database information, AnQiCMS 3.x will automatically recognize and inherit all data from the original 2.x child site when creating a new site, including articles, categories, pages, settings, and more.This, the original child site data has been seamlessly migrated, no additional import/export operations are required.The new site will not go through the initial installation steps but will directly load your existing content.

The final step is to configure reverse proxy for the newly integrated child site.In your web server (such as Nginx or Apache), add a reverse proxy configuration for the subdomain's domain, and proxy the traffic to the port that your 3.x main AnQiCMS instance is listening on (for example, 8001).Ensure that the Web server's runtime directory configuration points to the root directory of the sub-site/publicFolder. This way, when external users access the sub-site domain, the request will be correctly routed to the AnQiCMS 3.x instance via reverse proxy, and it will process and display the content of the corresponding site.

Verification and optimization after migration.

After completing the migration and configuration of all sub-sites, it is imperative to conduct a comprehensive access test for each site.

  • Verify that the front-end page is displayed normally, including the home page, article list, detail page, single page, etc.
  • Log in to the backend of each child site, check if the content, categories, tags, and other data are complete, and whether all functions (such as publishing, editing, SEO settings) are running normally.
  • Confirm whether the pseudo-static rules are effective, and whether the URL structure is consistent with the expected one.
  • Check if the template file is loaded correctly, especially for sites that may have some custom template paths in version 2.x. The template mechanism in version 3.x is more standardized, and it may be necessary to according todesign-convention.mdanddesign-director.mdTune it up.

By unifying all sites under the AnQiCMS 3.x multi-site management mode, you will be able to efficiently manage the content and configuration of all sites from a single admin interface, while enjoying the performance and security improvements brought by version 3.x.

Frequently Asked Questions

What are the main advantages of the AnQiCMS 2.x upgrade to 3.x multi-site migration plan?

The multi-site management mode of AnQiCMS 3.x allows all sites to run under a single program and to be managed through a unified backend interface.This greatly simplifies the deployment complexity, reduces resource consumption, and makes subsequent system updates and maintenance more convenient and efficient.In addition, the 3.x version is based on the high concurrency characteristics of the Go language, which also brings better performance and security to the site.

Will my data be lost when integrating the 2.x child site into the 3.x multi-site management system?

I won't. AnQiCMS 3.x designed a seamless inheritance mechanism.When you add a new site, as long as you correctly fill in the physical root directory and database information of the existing 2.x sub-site, the system will automatically recognize and load all old content and settings.Therefore, your articles, categories, pages, and other key data will be fully retained and migrated.

Can I directly use a custom template developed in the 2.x version in the 3.x version?

Due to some adjustments in template tags and structure of AnQiCMS 3.x, although the template engine syntax (similar to Django templates) remains consistent, some old template files may need to be slightly modified to adapt to the new data model and tag usage.You need to refer todesign-convention.md/design-director.mdandtag-*.mdWait for the document, compare and update the template code to ensure it runs and displays normally in the 3.x environment.