You will need to extend the function to the bulk, then export that. For example:
fes_BDY = FacetFESpace(mesh, order=0, definedon="", definedonbound=BDY_name)
gf_u_bdy = GridFunction(fes_BDY)
fes_BULK = H1(mesh, order=1)
gf_u_bdy_ext = GridFunction(fes_BULK)
gf_u_bdy_ext.Set(gf_u_bdy, definedon=mesh.Boundaries(BDY_name))
Then try: Draw(gf_u_bdy_ext, mesh, "u_bdy_ext") in the netgen gui.
If that works, then you could just export that.