I suggest you stop the V1 jail, rename it something like
caddy1
, then restart it and make sure your reverse proxy is still functioning. It will take you a while to get your head around the new syntax for V2 and you'll need time to migrate your Caddyfile across.
and install v2 in a new jail like caddy2
While you certainly can do this, the script defaults to using the name
caddy
, so the path of least resistance is to name your V2 jail so.
If you've exposed your reverse proxy to the internet, ports 80 and 443 will be forwarded to your V1 jail. Be prepared to switch the ports between your V1 and V2 jails several times while you're doing the migration. You may not be able to complete the migration in one sitting so you'll need to keep your V1 reverse proxy working until then. Before you start the migration, make a backup copy of your V1 Caddyfile just in case you mess up your working copy.
I recommend migrating a simpler Caddyfile block first. Once you've got that working, migrate and test other blocks that look similar. Repeat for other groups of look-alike code blocks. Deal with unique code blocks last.
As you get familiar with the syntax, you'll begin to notice that the V2 code blocks are considerably shorter and more readable as well. Good luck and enjoy the journey.
test and then destroy caddy v1 jail when all is working?
I'd keep the V1 jail around after the migration, at least for a while (I'm nostalgic like that), but turn it off and uncheck jail autostart.