Skip to content
orbitpush

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:

  1. Reads netlify.toml from the current directory, and _redirects and _headers from the output directory. If your build copies those files into it, build first.
  2. Writes them to redirects and headers in orbitpush.json: _redirects first, then the [[redirects]] of netlify.toml, the order Netlify applies them in. Headers keep the same order, _headers first, so netlify.toml wins when both set a header for a URL. Netlify does not document this order.
  3. Warns about every rule that deploy will skip because bunny.net can’t serve it, such as rewrites or Language conditions. These rules are still written, so the file stays a complete copy.

What it leaves out

  • Basic-Auth headers, 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.json already has redirects or headers.
  • It never changes or deletes the Netlify files, so the site keeps working on Netlify.
  • It rewrites orbitpush.json in the format init writes, so fields left out before, such as an empty aliases, 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.