Skip to content
Syno Package Land
Language: English

Data and removal

An upgrade keeps your app’s data, and an uninstall keeps it too unless the user ticks one box in the wizard. Handler data in the data folder survives upgrades, and Compose named volumes are always kept.

A native-go backend writes to /var/packages/<package>/var, which DSM stores at @appdata/<package>. Files inside the SPK are replaced on upgrade, so write anything that must survive to the data folder.

LocationHoldsData box ticked
@appdata/<package>Handler data; Compose ${SYNOPKG_PKGVAR} bind mountsContents deleted
@apphome/<package>Home folder with generated secretsContents deleted
@appconf/<package>Saved configurationContents deleted
A Shared FolderFiles in a folder chosen at installNever deleted
A Docker named volumeContainer state, Compose onlyNever deleted

All of them survive upgrades.

A native-go project uses github.com/synopackageland/syno-pkg-land-sdk/datamigrate to apply numbered schema steps to the data folder. Add steps to Migrations() in backend/internal/app/migrations.go:

{
Version: 1,
Name: "example",
Apply: func(ctx datamigrate.Context) error {
// Read ctx.DataDir. Write a temporary file, then rename it.
return nil
},
},
RuleDetail
NumberingVersions start at 1; a version never changes meaning
When it runsPending steps run at the start of each request; a failed step fails that request. Progress is stored in <data folder>/data-version
IdempotentEach step must be safe to run twice; a crash before the version is recorded runs it again
FailureThe last successful version stays recorded and the next request resumes; the helper never deletes or rewrites data
Versionsctx.OldPkgVer is the pre-upgrade version, ctx.NewPkgVer the running one

The CLI backs nothing up, and the wizard says Hyper Backup is not checked and no recoverable backup can be verified. Back up @appdata/<package> always, plus @apphome/<package> and @appconf/<package> when used, the Shared Folder when the app uses one, and named volumes for Compose.

Approvals and delegations are not data: a reinstall needs a fresh approval and new destinations.

An upgrade keeps the data folder and runs pending schema steps. If @appdata/<package> exists, the install wizard says the install reuses that data and how to start empty. Version and build rules are in Ship.

The wizard has one checkbox, unchecked by default: “Also delete the app data listed above”. It lists the folders it empties and says Shared Folders, the package account and other apps’ data are never deleted.

ChoiceResult
UncheckedData stays; reinstalling the same package name reuses it
CheckedEmpties @appdata, @apphome and accessible @appconf contents; the folders stay. A folder outside the package’s own area is skipped
An upgrade with the box checkedNothing is deleted

For Compose, the wizard lists the named volumes from app_data and warns that delete-data keeps them; the message marks them COMPOSE_DATA_RETAINED (see Container apps). To run the uninstall, see the CLI reference.

DSM may keep empty @appdata, @appconf, @apphome and @appshare folders, the /usr/syno/etc/packages/<package> link and the package account; an administrator can review and remove them.

DSM keeps an uninstalled app’s rules in Control Panel > Application Privileges, and a later install under the same name applies them again. For a portal app, DSM removes the alias but the web server serves it until reload. Only root can clean either; see Capabilities.

KindRulesLogin Portal address
Executor app (delegate or root-ops)Deleted by the executor at uninstallReloaded by the executor, so the address stops
App without privilegesKept; the wizard names the manual stepNone; it cannot declare portal

The executor logs failures to synopkgland-executor and the uninstall continues; the manual steps are the fallback.

Only delegate and root-ops packages have one; see Capabilities and Root operations.

  • Install: status shows needs-admin-approval until a DSM administrator confirms their password once in the app window.
  • Upgrade: the executor resumes when the approved policy still matches, and a new executor installs only if its SHA-256 matches synopkgland_executor_sha256 in the root-owned INFO. Changing entry, scope, destinations, lifetime, operations or root/*.sh needs a new approval; a version bump does not. A scope change revokes delegations, and users pick destinations again.
  • Uninstall: the approval, delegations, the <package> executor boot, <package> executor control and <package> executor selection tasks, and the Application Privileges rules are removed. Tasks go in the background after a name, owner and script check, so a timeout does not stop the uninstall.

An executor app whose cleanup failed (the synopkgland-executor log says why) can leave root tasks, Application Privileges rules and a Login Portal address. An administrator removes them by hand:

LeftoverRemove it
<package> executor control and <package> executor selectionControl Panel > Task Scheduler
<package> executor bootDSM refuses to delete it over HTTP (error 119). As root, run /usr/syno/bin/synowebapi --exec api=SYNO.Core.EventScheduler method=delete version=1 task_name="<package> executor boot"
Application Privileges rulesControl Panel > Application Privileges
A Login Portal address that still opensSave any alias in Control Panel > Login Portal > Applications, which reloads the web server, or restart the NAS
  • The uninstall box deletes only @appdata, @apphome and @appconf contents; Shared Folders, named volumes and the package account are never deleted.
  • No backup is configured or verified, and the schema step helper is native-go only.
SymptomCauseFix
A reinstall starts with the earlier settings, or empty folders remain after a box-ticked uninstallThe earlier uninstall kept the data, or DSM kept folder rootsUninstall again with the box ticked; remove folders as an administrator
needs-admin-approval or blocked: executor_status_mismatchThe policy changed, the INFO anchor does not match, or the executor reports other digestsA DSM administrator approves in the app window; otherwise reinstall that executor’s package