-
Notifications
You must be signed in to change notification settings - Fork 0
migration from bash
This document is procedural guidance.
It explains how an operator should migrate from the historical FireHOL bash pipeline to the Go implementation while preserving state and minimizing surprises. This page is procedural; use the API, feed, and filesystem docs for the operator-visible compatibility surfaces.
The migration goal is to move the installation to the Go daemon without losing:
- catalog identity
- useful historical local state
- public/mirror consumers that still rely on compatibility artifacts
Prefer staged cut-over, not blind replacement.
Recommended high-level approach:
- inventory what the bash deployment currently publishes and what consumes it
- preserve the old state and cache
- start the Go daemon against equivalent configuration and directories where required
- validate feed count, public outputs, and admin/runtime behavior
- switch traffic and downstream consumers only after verification
The canonical helper for importing a bash-era installation into the Go layout is:
./scripts/sync-from-bash-version.sh <source-host|localhost> [INSTALL_DIR]
Meaning:
- use
localhostwhen the old bash layout is on the same machine - use a hostname when importing over ssh/rsync from another machine
- omit
INSTALL_DIRto use/opt/update-ipsets
The older scripts/sync-from-d1.sh name may still exist as a compatibility wrapper
while operators transition, but the canonical documented interface is
scripts/sync-from-bash-version.sh.
The helper assumes the historical FireHOL paths by default. If the old installation used different paths, set these environment variables before running it:
| Variable | Default | Meaning |
|---|---|---|
BASH_BASE |
/etc/firehol/ipsets |
Old committed feed body, history, and related data tree. |
BASH_LIB |
/var/lib/update-ipsets |
Old library/state directory. |
BASH_CONFIG |
/etc/firehol/update-ipsets.conf |
Old monolithic bash configuration file. |
BASH_WEB |
/var/www/blocklists |
Old published website/mirror tree. |
Example:
BASH_BASE=/srv/firehol/ipsets \
BASH_LIB=/srv/firehol/lib \
BASH_WEB=/srv/www/blocklists \
./scripts/sync-from-bash-version.sh old-host /opt/update-ipsetsThe helper performs the migration in staged steps:
- Stops the Go daemon if it is currently running.
- Creates a pre-sync backup under
INSTALL_DIR/backups/. - Imports the old bash data, library, website, and config into
INSTALL_DIR/import-bash-version/. - Builds manifests for imported feeds and local-only Go feeds.
- Copies staged data into the live Go
data/,lib/, andweb/trees. - Merges the legacy
.cacheinto Go.cache.jsonwhen the legacy cache is present. - Extracts known legacy API-key variables into
INSTALL_DIR/.update-ipsets.env. This includesAUTOSHUN_API_KEY,BLUELIV_API_KEY,XFORCE_API_KEY,XFORCE_API_PASSWORD,IP2LOCATION_API_KEY, andMAXMIND_LICENSE_KEYwhen they are present in the legacy config. - Removes stale duplicate legacy
latest.setfiles when the corresponding currentlatestfiles exist. - Restarts the Go daemon only if it was running before the migration started.
The helper prints a summary with feed counts, history snapshot counts, copied web artifacts, backup path, manifest path, and environment file path.
Before migration, identify:
- the current bash catalog source
- whether downstreams consume:
- raw feed outputs
- history CSVs
- changeset CSVs
- feed metadata JSON
- website/mirror files
- whether the old
.cachefile contains state you want to preserve - whether the deployment uses legacy FireHOL directory conventions
- whether any custom automation expects specific filenames or paths
- whether the old installation uses
/etc/firehol/ipsets/history/{feed}/*.setso those retained history snapshots can be copied into the Go installation's canonicaldata/history/{feed}/{unix_timestamp}.setlayout
Preserve at least:
- the old configuration inputs
- the old
.cache - current published/public output directories
- any legacy directories still consumed by downstream tools
Choose one:
-
side-by-side migration
- safest
- lets you validate the Go product before replacing the bash service
-
in-place migration
- simpler operationally
- higher risk if hidden downstream dependencies exist
If there is any uncertainty about existing consumers, prefer side-by-side.
Use the canonical Go-era configuration model.
If migration depends on legacy catalog extraction, treat that as a migration aid, not as the long-term source of truth.
If historical state continuity matters:
- use the canonical helper so it can import the legacy cache and preserve local-only Go cache entries
- preserve legacy committed outputs long enough to compare results
The helper uses the cache-merge subcommand internally when it finds a legacy .cache file. Operators normally run scripts/sync-from-bash-version.sh instead of invoking cache-merge directly.
Bring up the Go daemon and confirm:
- service health
- downloader activity
- processing activity
- public artifact generation
- admin visibility
Check the outputs that real consumers depend on.
At minimum validate:
- raw downloadable sets
- feed metadata artifacts
- history and changeset artifacts
- website/API consumers of public data
- any migrated bash history/retention evidence that was translated into the Go-native layout
Pick representative feeds across families:
- direct upstream feed
- history derivative
- merge
- artifact-backed feed
- provider-enriched feed page
Confirm they produce the expected public outcomes.
Only after validation:
- switch website/public routing if needed
- switch mirror/downstream consumers
- disable the bash updater
The migration should not be considered complete until you have confirmed:
- the expected catalog size is present
- expected feed names and categories are present
- downloader and processing queues behave correctly
- public feed pages render from current published artifacts
- pairwise comparisons are current
- provider enrichments are present where expected
- compatibility artifacts needed by legacy consumers still exist
- assuming no one consumes history or changeset artifacts
- migrating configuration but not state
- letting the public site depend on live runtime recomputation during cut-over
- removing bash-era compatibility files before confirming their consumers are gone
- treating side-by-side output differences as bugs before checking whether they are specification changes
Rollback is simplest when:
- the bash-era state was preserved
- the Go deployment was first validated side-by-side
- the cut-over point was explicit
If rollback may be needed, preserve the pre-cut-over published output tree and legacy cache until the Go deployment is considered stable.
- Daemon Command Reference
- Environment Variables
- Configuration Reload
- Listener Topologies
- Admin Authentication
- Feed Families
- Source Feeds
- Processor Reference
- Static Feeds
- Merge Feeds
- Artifact Parents
- History Derivatives
- Provider Databases
- Use Roles
- Critical Infrastructure Reference Feeds
- Legal Fields
- Feed Visibility & Lifecycle
- YAML Field Reference
- Pipeline Overview
- Download Lifecycle
- Processing Lifecycle
- Feed Status Reference
- Health Classes
- What Triggers Reprocessing
- Accessing the Admin
- Runtime Status
- Feed Inventory
- Artifact Inventory
- Live Queues
- Background Work
- Schedule State
- Operator Actions
- Enable & Disable