Migrate from Snap Store Proxy to Enterprise Store¶
Snap Store Proxy has been renamed to Enterprise Store. The Snap Store Proxy snap will be maintained for the time being, but it is recommended to upgrade to the Enterprise Store snap.
On the system with Snap Store Proxy installed:
Install the Enterprise Store snap.
In an online context, run:
snap install enterprise-store
In an offline context, first download the snap and its assertions on a machine with internet access, e.g.:
snap download enterprise-store --channel=latest/stable
Then move the files over to the offline enterprise-store machine and:
sudo snap ack enterprise-store_<revision>.assert
sudo snap install enterprise-store_<revision>.snap
Copy over important files from the Snap Store Proxy’s common directory to the Enterprise Store’s common directory:
sudo cp -r /var/snap/snap-store-proxy/common /var/snap/enterprise-store/
Verify that the files were copied over:
# Outputs should look similar
ls -R /var/snap/snap-store-proxy/common
ls -R /var/snap/enterprise-store/common
Export the existing configuration with:
sudo snap-store-proxy config --export-yaml | cat > store-config.yaml
Warning
The YAML file should be stored securely, since it includes sensitive data like secrets.
Note
If the --export-yaml
option is unavailable, upgrade to the latest
version of the snap-store-proxy
snap, which will contain the
--export-yaml
option.
Import the configuration to the Enterprise Store:
cat store-config.yaml | sudo enterprise-store config --import-yaml
This command will fail if Snap Store Proxy is running, as the Enterprise Store service ports conflict with the existing Snap Store Proxy service ports. This is expected. An example output of this is:
Set the Enterprise Store’s
internal.snapstorage.local-origin-secret
secret configuration value to the equivalent value from the Snap Store Proxy’s.
Check if it was set with:
sudo snap get snap-store-proxy internal.snapstorage.local-origin-secret
If the option was set (no error with the command above), also set the option in the Enterprise Store:
sudo enterprise-store config internal.snapstorage.local-origin-secret="$(sudo snap get snap-store-proxy internal.snapstorage.local-origin-secret)"
This command will fail with an expected output similar to:
Set the Enterprise Store’s
internal.airgap.gateway-hash
configuration value to the equivalent value from the Snap Store Proxy’s.
Check if it was set with:
sudo snap get snap-store-proxy internal.airgap.gateway-hash
If the option was set (no error with the command above), also set the option in the Enterprise Store:
sudo enterprise-store config internal.airgap.gateway-hash="$(sudo snap get snap-store-proxy internal.airgap.gateway-hash)"
This command will fail with an expected output similar to:
Replace the Snap Store Proxy’s services with the configured Enterprise Store.
Disable the Snap Store Proxy snap (this may cause temporary downtime):
sudo snap disable snap-store-proxy
Start the Enterprise Store services:
sudo snap start enterprise-store
Check the status:
enterprise-store status
Note
If anything goes wrong during the downtime after disabling the snap-store-proxy snap, revert to the initial state by running:
sudo snap stop enterprise-store
sudo snap enable snap-store-proxy
sudo snap start snap-store-proxy
sudo snap disable enterprise-store
Check the status:
snap-store-proxy status
Make a backup of the
snapstorage.package_store
table in the PostgreSQL database, to use in case the next step goes wrong.Connect to the PostgreSQL database and update the
bucket
locations in the snapstorage database to use theenterprise-store
for the location, instead ofsnap-store-proxy
.
For example, given the record:
-[ RECORD 1 ]+------------------------------------------------------------
id | 1
object_uuid | b124b223-6841-44cc-8a74-5cf4f8905989
path | LpV8761EjlAPqeXxfYhQvpSWgpxvEWpN_414.snap
bucket | /var/snap/snap-store-proxy/common/snapstorage-local/scanned
content_type | application/octet-stream
object_type | snap
object_size | 7897088
mark_deleted | f
when_created | 2025-08-29 05:25:40.236165
the new record should look like:
-[ RECORD 1 ]+------------------------------------------------------------
id | 1
object_uuid | b124b223-6841-44cc-8a74-5cf4f8905989
path | LpV8761EjlAPqeXxfYhQvpSWgpxvEWpN_414.snap
bucket | /var/snap/enterprise-store/common/snapstorage-local/scanned
content_type | application/octet-stream
object_type | snap
object_size | 7897088
mark_deleted | f
when_created | 2025-08-29 05:25:40.236165
The following SQL transaction should yield the desired outcome:
BEGIN;
-- Consider double-checking the state before and after the UPDATE
-- SELECT * FROM snapstorage.package_store;
UPDATE snapstorage.package_store SET bucket = regexp_replace(bucket, '\/var\/snap\/(snap-store-proxy)', '/var/snap/enterprise-store', 'g');
-- SELECT * FROM snapstorage.package_store;
COMMIT;
Verify that functionality for existing devices/clients still works.
If testing snap installs, keep in mind that snapd
may have cached
previously downloaded snaps at /var/lib/snapd/cache/
. Additionally,
the Enterprise Store may have cached snap downloads too. It may be
more suitable to clear the Enterprise Store cache and test directly
against the API:
sudo find /var/snap/enterprise-store/common/nginx/cache -maxdepth 1 -type f -delete
curl --fail 'https://my-store.test/api/v1/snaps/download/LpV8761EjlAPqeXxfYhQvpSWgpxvEWpN_414.snap' -o 'LpV8761EjlAPqeXxfYhQvpSWgpxvEWpN_414.snap'
Remove the Snap Store Proxy snap:
sudo snap remove snap-store-proxy