This invention relates to a method for the enzymatic synthesis of oligosaccharides, preferably human milk oligosaccharides (HMOs) The method comprises the enzymatic transfer of a glycosyl moiety and subsequent removal of by-products, such as lactose, by nanofiltration using a membrane comprising an active polyamide layer.