How to migrate configs

What is the recommended way to migrate config file entries?

I wish to make some modifications in dnsmasq itself which will require migration of dnsmasq settings (i.e. /etc/config/dhcp).

i.e. change a variable name (it's old, possibly unused, but need to handle migration).

Is some /etc/init.d/ script which runs at boot time (after every boot) a good way?

Or should one handle the old and new variables for a while and sunset the old one eventually?

I found this example but it's js, and only runs when GUI is accessed (I think), so might not cover all cases.



I guess this is an acceptable way to migrate.

I'll mark these as the solution, although I was hoping for developer input on recommended ways to migrate.

1 Like

The code in the github repo which @vgaetera kindly linked for your is written by developers, so it is a developer input. :wink:

If you figure out a better (than uci-defaults as linked above) way, please let me know, because that's also what I use in my packages.


True :slight_smile:

Just Rafals example does migrations in luci. I guess we rarely need migrations.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.