@geezer78
All your channels/apps are tied to your Roku account so it does not matter the order of when you Factory Reset the Ultra device. Just make sure you use the same Roku account (same email address) when you set up your new Ultra and all your channels/apps will transfer over.
After you Factory reset the Ultra you are giving away, also make sure you go to your online account dashboard at https://www.roku.com/ and "unlink" that particular Ultra from your account. (Just an extra step that helps to protect your account).
Personally, I would set up the new Ultra first and make sure it is working before I would Factory Reset and give away my old one.
Roku Community Streaming Expert
Just another Roku user... I am not a Roku employee.
Insignia RokuTV, Ultra 4660, Premiere+ 3921, Express 4k+ 3941, Streambar 9102