orbitpush migrate-netlify
Copy the redirects and headers of a Netlify site into orbitpush.json.
npx orbitpush migrate-netlify
Run it after init, in the directory with orbitpush.json. It:
- Reads
netlify.tomlfrom the current directory, and_redirectsand_headersfrom the output directory. If your build copies those files into it, build first. - Writes them to
redirectsandheadersinorbitpush.json:_redirectsfirst, then the[[redirects]]ofnetlify.toml, the order Netlify applies them in. Headers keep the same order,_headersfirst, sonetlify.tomlwins when both set a header for a URL. Netlify does not document this order. - Warns about every rule that
deploywill skip because bunny.net can’t serve it, such as rewrites orLanguageconditions. These rules are still written, so the file stays a complete copy.
What it leaves out
Basic-Authheaders, which hold passwords- redirects without
to - everything else in
netlify.toml, such as the build command or functions
Safety
- It stops without writing when
orbitpush.jsonalready has redirects or headers. - It never changes or deletes the Netlify files, so the site keeps working on Netlify.
- It rewrites
orbitpush.jsonin the formatinitwrites, so fields left out before, such as an emptyaliases, appear with their defaults.
After the migration, a change to a Netlify file does not reach orbitpush, and a change to orbitpush.json does not reach Netlify.
See Migrating from Netlify for the whole move, and Redirects and Headers for what is supported.