npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sehlceris/migrate-openwrt-router-config

v0.1.1

Published

Migrate OpenWrt router configurations between any two routers. Transfers VLANs, WiFi SSIDs, firewall rules, DHCP leases, and more — no hardcoded profiles needed.

Readme

migrate-openwrt-router-config

Migrate OpenWrt router configurations between any two routers. Transfers VLANs, WiFi SSIDs/passwords, firewall zones/rules, DHCP static leases, and more — with no hardcoded router profiles.

The tool auto-discovers hardware capabilities (LAN ports, radios, bands, ifname patterns) from backup files and interactively maps your source config onto the destination hardware.

Disclaimer

This has only been tested with one router transition: Belkin RT3200 (Linksys E8450) → GL-iNET MT6000 (Flint 2) Although this script should be generic enough and may be worth a try, please note that this has not been tested thoroughly. Be prepared and able to do a 30/30/30 reset on your router if things go wrong.

What it migrates

  • VLANs / Bridge VLANs — network segmentation (LAN, IoT, Guest, Work, etc.)
  • WiFi Networks — SSIDs, passwords, encryption, band assignments, client isolation
  • Firewall — custom zones, rules, forwardings, port forwards (deduplicated with destination)
  • DHCP — static leases, DHCP pools for custom networks

What it does NOT migrate (kept from destination)

  • Installed packages
  • WAN configuration (device, protocol, metrics)
  • Radio hardware settings (channels, tx power, country code)
  • SSH keys and certificates
  • System hostname and timezone
  • Root password
  • Vendor-specific configs (GL-iNET, etc.)

Prerequisites

1. Back up both routers

Before running this tool, you need a backup .tar.gz from both your old (source) and new (destination) routers.

On each router:

  1. Open LuCI (usually http://192.168.1.1)
  2. Go to System → Backup / Flash Firmware
  3. Click Generate archive to download a .tar.gz backup

You should end up with two files, e.g.:

  • backup-old-router.tar.gz — the router you're migrating from
  • backup-new-router.tar.gz — the router you're migrating to (fresh or factory-reset)

2. System requirements

  • Node.js >= 18
  • tar available in PATH (standard on macOS/Linux)

Installation

Via npx (no install needed)

npx @sehlceris/migrate-openwrt-router-config <source-backup.tar.gz> <dest-backup.tar.gz>

Global install

npm install -g @sehlceris/migrate-openwrt-router-config
migrate-openwrt <source-backup.tar.gz> <dest-backup.tar.gz>

Local development (npm link)

git clone https://github.com/sehlceris/migrate-openwrt-router-config.git
cd migrate-openwrt-router-config
npm link
migrate-openwrt <source-backup.tar.gz> <dest-backup.tar.gz>

Usage

Interactive mode (default)

migrate-openwrt backup-old-router.tar.gz backup-new-router.tar.gz

The tool will:

  1. Extract both backups into source/, unmodified/, and migrated/ directories (next to the source backup)
  2. Show you what it found in each backup
  3. Ask you to assign LAN ports to each VLAN/network
  4. Ask you which WiFi bands each SSID should broadcast on
  5. Show a migration plan summary
  6. Apply the migration and create migrated-<date>.tar.gz

Folder mode

If both positional arguments are directories instead of .tar.gz files, the tool automatically uses folder mode — no extra flags needed. This is useful for testing and development.

migrate-openwrt source-config-dir/ dest-config-dir/

In folder mode the tool:

  • Skips tar extraction and archive creation
  • Reads source and destination configs directly from the given directories
  • Creates a migrated/ directory as a sibling of the destination directory
  • Overwrites migrated/ on re-run
  • Prints the migrated directory path instead of an archive path

Non-interactive mode

migrate-openwrt -y \
  --port-map lan=lan1,lan2,lan3 \
  --port-map iot=lan5 \
  --port-map work=lan4 \
  backup-old.tar.gz backup-new.tar.gz

Options

| Flag | Description | | ------------------------- | ------------------------------------------ | | -y, --non-interactive | Accept all defaults without prompting | | --port-map NAME=PORTS | Assign LAN ports to a network (repeatable) |

After migration

  1. Review the files in migrated/etc/config/ before uploading
  2. Have physical access to the router in case a factory reset is needed
  3. Set the root password separately after restoring the backup

How it works

  1. Extracts both backup archives
  2. Discovers destination hardware from its config (bridge ports, radios, ifname patterns, vendor)
  3. Extracts logical configuration from the source (VLANs, SSIDs, firewall rules, DHCP leases)
  4. Maps source config onto destination hardware (port assignment, band selection)
  5. Merges source config into a copy of the destination backup, preserving vendor-specific and hardware-specific settings
  6. Archives the result as an OpenWrt-compatible backup

Supported routers

Any OpenWrt-based router should work. Tested with:

  • Belkin RT3200 (Linksys E8450) → GL-iNET MT6000 (Flint 2)

The tool handles differences in:

  • LAN port count and naming
  • WiFi driver types (mac80211 vs mtk)
  • Bridge VLAN (DSA) configurations
  • Vendor-specific extensions (GL-iNET glconfig, etc.)

Publishing to npm

# Log in to npm (one-time)
npm login

# Publish (scoped packages are private by default, use --access public)
npm publish --access public

License

MIT