Then, when I tried to read the new file I get a lot of warnings as this:
Warning in TBasket::ReadBasketBuffers: basket: has fNevBuf=0 but fEntryOffset=0, pos=54544099, len=6157, fNbytes=0, fObjlen=0, trying to repair
What you do cannot work because you write only the tree header on the new file but not the branch baskets.
I suggest the following procedure to take advantage of the optimisation facilities
introduced in version 5.26