This topic describes how to upgrade ack-dify from an earlier version to 1.0.0 or later in a Container Service for Kubernetes (ACK) cluster. To perform the upgrade, you need to back up the ack-dify data, run commands to extract and install plug-ins, migrate data, and verify that the plug-ins operate normally. After completing these steps, you can use the new plug-in ecosystem.
Applicable scope
Current version: earlier than 1.0.0.
Target version: 1.0.0 or later.
1. Back up the data of ack-dify
Use the backup center feature to back up the data of the ack-dify application in the dify-system namespace. For more information, see Back up instantly.
2. Upgrade ack-dify
Log on to the Container Service Management Console. In the navigation pane on the left, select Clusters. Click the name of the target cluster. On the cluster details page, choose Applications > Helm. On the Helm page, find ack-dify and click Update. Then, select the latest version and click OK to complete the ack-dify component update.
3. Migrate plug-ins
3.1 Log on to the ack-dify API container
kubectl exec -it <ack-dify-api-xxxxx-xxxxx> -n dify-system -- bash3.2 Extract plug-ins
poetry run flask extract-plugins --workers=20If the system prompts you to input content, press Enter to skip the prompt.
3.3 Install plug-ins
poetry run flask install-plugins --workers=2Make sure that your cluster can access the Internet and https://marketplace.dify.ai.
4. Migrate data
To ensure better compatibility, make sure that ack-dify is not rolled back to an earlier version and run the following command to migrate data:
poetry run flask migrate-data-for-plugin5. Verify the upgrade
Access the Dify platform.
Check whether plug-ins are installed on the Dify platform.
Select a random plug-in and test whether the plug-in runs as normal to verify the data migration.
Rollback
If you want to roll back ack-dify to an earlier version, perform the following steps:
Log on to the ACK console. In the navigation pane on the left, click Clusters. Click the name of the cluster that you want to manage. On the cluster details page, choose Applications > Helm. On the Helm page, find the ack-dify release and click Delete in the Actions column. Click OK. Then, manually delete all persistent volume claims (PVCs) used by ack-dify.
Restore ack-dify using the backup center feature:
Select the backup file you created in the corresponding backup vault.
Restore data to the
dify-systemnamespace. After the restoration is complete, you can accessack-dify.
To ensure that data migration is completed and plug-ins run as normal, do not roll back ack-dify immediately after it is upgraded.
If you encounter issues during the upgrade, refer to Migrating Community Edition to v1.0.0.
FAQ
The time required for restoring data from the backup file depends on the amount of data and network conditions.
If plug-ins fail to be migrated, check whether the cluster can access
https://marketplace.dify.ai.If data fails to be migrated, run the migration command again.
Disclaimer
Dify on ACK is a Helm deployment solution that adapts the open source Dify project specifically for the Alibaba Cloud ACK environment, enabling rapid deployment of Dify on ACK. ACK does not guarantee the operation of the Dify application itself or its compatibility with other ecosystem components such as plug-ins and databases. ACK does not provide compensation or other commercial services for business losses caused by defects in Dify itself or its ecosystem components during your use of Dify. We recommend that you follow updates from the open source community and proactively fix issues in the open source software to ensure the stability and security of Dify.