I'd suggest using calibre or similar to make alternate copies of any digital books you buy and storing them as backups in files completely outside any device you use to read them with (especially a DRM'd device). This can get tricky with newer editions of media through devices like Amazon's kindle, but there are usually workarounds. You bought them, they are rightfully yours and fuck any "ownership" model that treats what you bought as something to be taken away from you on a bullshit legal whim.
Also, if some DRM'd digital book you've bought is truly impossible to remove from the device you're using to read it, an alternative is to just pirate a copy from certain obvious sites (cough, libgen, cough) as a backup edition in a format you fully control. Since you did indeed buy the book, also having a pirate copy is at least morally legit as far as compensating the author goes, even if it's legally shaky. Then again, many laws themselves are legally shaky, if not morally too. This applies especially to all the absurd legal contortions and false outrage practiced by proponents of the legal dumpster fire that is DRM.
Also, if some DRM'd digital book you've bought is truly impossible to remove from the device you're using to read it, an alternative is to just pirate a copy from certain obvious sites (cough, libgen, cough) as a backup edition in a format you fully control. Since you did indeed buy the book, also having a pirate copy is at least morally legit as far as compensating the author goes, even if it's legally shaky. Then again, many laws themselves are legally shaky, if not morally too. This applies especially to all the absurd legal contortions and false outrage practiced by proponents of the legal dumpster fire that is DRM.