Dear colleagues, as a long-term front-line website operator 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 documents of AnQiCMS, and give you a detailed explanation of this process to ensure a smooth transition for your multi-site.
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 greatly reduces the operation and maintenance costs through Go project management and a unified multi-site backend, enhancing 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 the multi-site upgrade is to handle the AnQiCMS master instance you are currently deploying. This master instance is usually the first one you installed or the site with multi-site management permissions.
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.start.sh) To perform a restart operation, make sure that the program can start normally after the upgrade.If the background version information does not update in time after the restart, please try to clear 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 version 2.x.Then, follow the installation guide of AnQiCMS 3.x, and add this AnQiCMS instance as a Go project in your server management panel (such as Baota panel).anqicmsExecutable file, and use the port that your current site is listening to (usually 8001).By this means, the newly deployed 3.x version will directly inherit the configuration and data of your existing site, without the need for reinitialization installation.
Integrate 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 deal with the remaining 2.x version sub-sites.In the 3.x version, all sub-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 your upgraded 3.x main AnQiCMS instance, go to the "Multi-site Management
This is a key step in the data migration process on the interface for adding new sites. Please fill in all the information carefully:
- Site Name:According to the actual use of the sub-site for naming, it 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 original 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.com,so that the new site can recognize and use the existing static resources and file structure. - Website address:Please fill in the domain name of your sub-site, make sure that the domain name has been resolved and bound to the server.
- Administrator account and passwordSet up a separate admin account and password for the new site.
- Database namePlease fill in the database name used by the original 2.x child site.
- Database information reuse:If you have a 2.x sub-site 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 to specify the original root directory and database information, so AnQiCMS 3.x will automatically identify and inherit all data of the original 2.x sub-sites when creating a new site, including articles, categories, pages, settings, and more.So, the seamless migration of the original child site data is completed without any additional import/export operations.The new site will not go through the initialization 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 its traffic to the port that your 3.x main AnQiCMS instance is listening on (for example, 8001)./publicFolder.So, when external users access the sub-site domain, the request will be correctly routed to the AnQiCMS 3.x instance via reverse proxy, which will handle and display the content of the corresponding site.
Verification and optimization after migration
After completing the migration and configuration of all child sites, be sure to perform 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 sub-site, check if the content, categories, tags, etc. are complete, and whether all functions (such as publishing, editing, SEO settings) are running normally.
- Confirm whether the pseudo-static rules are effective and the URL structure is consistent with expectations.
- Check if the template file is loaded correctly, especially for sites with some custom template paths in the 2.x version. The template mechanism in the 3.x version is more standardized, and it may be necessary to follow
design-convention.mdanddesign-director.mdPerform fine-tuning.
By unifying all sites under the multi-site management mode of AnQiCMS 3.x, you will be able to efficiently manage the content and configuration of all sites from a single backend interface, while enjoying the performance and security improvements brought by the 3.x version.
Frequently Asked Questions
What are the main advantages of the AnQiCMS 2.x upgrade to 3.x multi-site migration plan?
AnQiCMS 3.x's multi-site management mode allows all sites to run under the same 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 features of Go language, which also brings better performance and security to the site.
Will my data be lost when integrating 2.x sub-sites into the 3.x multi-site management system?
Will not.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 the old content and settings.Therefore, your articles, categories, pages, and other key data will be fully preserved and migrated.
If I have a custom template developed for the 2.x version, can I use it directly in the 3.x version?
Since AnQiCMS 3.x may have some adjustments in template tags and structure, although the syntax of its template engine (similar to Django template) remains consistent, some old template files may require minor modifications to adapt to the new data model and tag usage.design-convention.md/design-director.mdandtag-*.mdThis document, refer to the update template code, to ensure that it runs and displays properly in the 3.x environment.