Erasing drive, deleting photos from Macbook Air without deleting from iCloud
My wife has an old 2010 MacAir that we're loaning to a friend until he gets a decent machine in a few months. She has a large photo/video library and has it synced to iCloud. I want to clear the drive and reset the machine to factory settings. My worry is, if I erase the drive, will her iCloud library be safe? I was told that unchecking 'iCloud' in 'Settings' would allow me to erase without affecting the iCloud library, but then someone else said iCloud needs the original device (MacAIr) to hold the library as a reference point for the sync.
I'm also wary about exporting the library to an external drive before erasing, as it may mean I have to put the full library back into her new Macbook Pro drive for iCloud to re-sync.
I know my way around a Mac, but I've always stayed away from iCloud and am therefore quite clueless! Any help greatly appreciated.
MacBook Air 13″, macOS 10.13