Need help with varnish3to4?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

fgsch
123 Stars 26 Forks BSD 2-Clause "Simplified" License 95 Commits 0 Opened issues

Description

Varnish 3 to 4 migration script

Services available

!
?

Need anything else?

Contributors list

# 37,220
C
vcl
Perl
webasse...
88 commits
# 523,129
Python
Shell
varnish
vcl
2 commits
# 673,135
Python
varnish
vcl
Shell
1 commit
# 3,278
imagema...
sass-fr...
splash
pipelin...
1 commit
# 61,346
C
Haskell
Bash
Bootstr...
1 commit

varnish3to4

Join the chat at https://gitter.im/fgsch/varnish3to4

Script to assist migrating a VCL file from Varnish 3 to 4.x. [1]

Suggested usage

 $ varnish3to4 -o .v4 
 $ diff -u  .v4

To limit changes for Varnish 4.0:

 $ varnish3to4 -v 4.0 -o .v4 
 $ diff -u  .v4

Currently understands

V3

V4
{bereq,req}.backend.healthy std.healthy({bereq.backend,req.backendhint})
{bereq,req}.request {bereq,req}.method
bereq.* in vclpass and vclmiss req.*
{beresp,obj,resp}.response {beresp,obj,resp}.reason
beresp.storage beresp.storagehint
{client,server}.port std.port({client,server}.ip)
error code response return (synth(code, response))
obj.hits - writing to -
obj.* in vclsynth resp.*
obj.lastuse -
remove unset
req.backend req.backendhint
req.grace -
req.* in vclbackendresponse bereq.*
return (hash) in vclhash return (lookup)
return (hitforpass) set beresp.uncacheable = true;
return (deliver);
return (lookup) in vclrecv return (hash)
return (pass) in vclpass return (fetch)
return (restart) in vclfetch return (retry)
std.real2integer(..) [2] std.real2integer(.., n)
std.time2integer(..) [2] std.time2integer(.., n)
std.time2real(..) [2] std.time2real(.., n.n)
synthetic .. synthetic(..)
vclerror vclbackenderror and vclsynth
vclfetch vclbackend_response

Limited coverage

V3

V4
purge -

Won't be implemented

V3

V4
- vcl 4.0
- import directors
new xx = directors.yy();
xx.addbackend(ss);
set req.backend
hint = xx.backend();

Add imports resulting from changes in V4, complete purge handling and any other changes missing from this document.

N/A for 3.0 (for documentation only)

V4.0

V4.1
return (fetch) in vcl_hit [3] return (miss)

Notes

  1. Comments in VCL are treated as code and as such references within will be rewritten.
  2. Required in 4.1 and above.
  3. Optional in 4.1. Required in 5.0 and above.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.