| id | migrate |
|---|---|
| title | 🔁 Migration |
| sidebar_position | 10 |
The fiber migrate command upgrades an existing Fiber project to a newer
github.com/gofiber/fiber release.
It determines the current version from your go.mod file and applies any
necessary migration steps.
fiber migrate --to 3.0.0-t,--to– Target version to migrate to. Defaults to the latest release--hash– Commit hash for the Fiber version when migrating to a pseudo version--third-party– Refresh third-party modules likecontrib,storage, ortemplate. Provide a comma-separated list (e.g.--third-party=contrib,storage) and append@<commit>to pin to a specific commit-f,--force– Force migration even if already on the target version-s,--skip_go_mod– Skip runninggo mod tidy,go mod download, andgo mod vendor-v,--verbose– Enable verbose output during migration--include– Comma-separated list of files to include in the migration. Supports glob and regex patterns--exclude– Comma-separated list of files to exclude from the migration. Supports glob and regex patterns
Upgrade to the latest Fiber version:
fiber migrateMigrate to a specific release:
fiber migrate --to 3.0.0Use a commit hash for unreleased versions:
fiber migrate --to 3.0.0 --hash abcdef123456Refresh contrib packages to their latest versions:
fiber migrate --third-party=contribRefresh template packages to a specific commit:
fiber migrate --third-party=template@abcdef123456Refresh both contrib and storage packages at once:
fiber migrate --third-party=contrib,storageForce re-running migrations even if the version matches:
fiber migrate --to 3.0.0 --forceSkip go mod commands for offline environments:
fiber migrate --skip_go_modVerbose mode prints detailed progress and executed steps:
fiber migrate --verboseLimit the migration to specific files:
fiber migrate --include=internal/** --exclude="*_test.go"