How long diacetyl rest?

Doing a bopils fermented a week at 48 wyeast 2001. Brought up to 65. How long d-rest?

Does the beer taste like diacetyl?  If not, then you don’t need to do a D rest at all.  However it won’t hurt either.  For my lagers I typically raise temperature after the fermentation seems to be around 2/3 to 3/4 complete, then keep it there until fermentation is 100% complete.  Typically this will take 3-4 days, but sometimes it will take weeks.  Let the yeast be your guide.  When the airlock stops bubbling, the krausen falls, and the beer begins to clear, then you can chill back down to do your lagering phase.

after about 60-65% attenuation, I let it rise to 62F until finished, then start the slow temp reduction.

Do you rack off the cake before or after?

i dont rack until cold crash is completed at 30F ambient…that’s around day 22 from start of fermentation. then i rack directly to the keg.

I don’t rack to secondary.  Just leave the beer in primary until bottling day.  Experience of myself and many others has proven that autolysis takes many months to set in.  There is no real advantage of racking to secondary, just leave the beer in primary the whole time.