Migrate custom actions to the updated path during a Virtual Appliance upgrade.
The custom actions path has changed from the previous release. Create and run the following script to migrate custom actions during the upgrade.
- Create a migration script for custom actions (custom-actions-migrate.sh) in /var/appd/config .
- Edit
custom-actions.migrate.sh.
vi /var/appd/config/custom-actions-migrate.sh
#!/usr/bin/env bash
set -euo pipefail
# Configuration
OLD=/var/appd/data/custom-actions
NEW=/var/appd/config/custom-actions
ARCHIVE=${2:-custom-actions.tgz}
case "${1:-}" in
backup)
test -d "$OLD/actions" || { echo "No custom actions found at $OLD/actions"; exit 1; }
sudo tar -C "$OLD" -czf "$ARCHIVE" actions
echo "Backup created: $ARCHIVE"
;;
restore)
test -f "$ARCHIVE" || { echo "Backup file not found: $ARCHIVE"; exit 1; }
sudo mkdir -p "$NEW"
sudo tar -C "$NEW" -xzf "$ARCHIVE"
# Set permissions
sudo chown -R appduser:appduser "$NEW/actions"
sudo find "$NEW/actions" -type d -exec chmod 755 {} \;
sudo find "$NEW/actions" -type f -exec chmod 755 {} \;
echo "Restored custom actions to $NEW/actions"
;;
*)
echo "Usage: $0 backup [custom-actions.tgz] | restore <custom-actions.tgz>"
exit 1
;;
esac
- Change permissions of the migration script.
chmod +x /var/appd/config/custom-actions-migrate.sh
- Sync custom actions to the running controller.
appdcli controller actions-sync
- Create a custom action archive.
./custom-actions-migrate.sh backup custom-actions.tgz