RAW is unclear
Pact of the Tome reads:
Your patron gives you a grimoire called a Book of Shadows. When you gain this feature, choose three cantrips from any class’s spell list. While the book is on your person, you can cast those cantrips at will. They don’t count against your number of cantrips known.
If you lose your Book of Shadows, you can perform
a 1-hour ceremony to receive a replacement from your patron. This ceremony can be performed during a short or long rest, and it destroys the previous book. The book turns to ash when you die.
And book of Ancient secrets reads:
You can now inscribe magical rituals in your Book of Shadows. Choose two 1st-level spells that have the ritual tag from any class’s spell list. The spells appear in the book and don’t count against the number of spells you know. With your Book of Shadows in hand, you
can cast the chosen spells as rituals. You can’t cast the spells except as rituals, unless you’ve learned them by some other means. You can also cast a warlock spell you know as a ritual if it has the ritual tag.
On your adventures, you can add other ritual spells to your Book of Shadows. When you find such a spell, you can add it to the book if the spell’s level is equal to or less than half your warlock level (rounded up) and if you can spare the time to transcribe the spell. For each level of the spell, the transcription process takes 2 hours and costs 50 gp for the rare inks needed to inscribe it.
The rules for replacing your Book of Shadows are vague and by my reading of the RAW there are four possibilities. (Tweets by D&D designers confirm the first is correct).
Your replacement is just like your old book
This is I would argue both a valid reading of the RAW and probably the RAI. The rules neither say the new book is empty nor do they say it is full but they do say it is replaced and the best replacement would be an identical book. I would argue that a blank book could not be considered a replacement for a full one (I would certainly be pissed if someone gave me back a blank book when I lent them "Name of the Wind").
Mike Mearls asserts that this answer is correct, and Crawford confirms it.
Your book comes back with no rituals
Probably the strictest RAW interpretation is that you get a blank book back but still have access to the same three cantrips. The pact does not explicitly state that the cantrips are recorded in the book only that having your Book of Shadows on your person allows you to cast them at will. Therefore they will neither change nor go away when you get a replacement. Nothing in the description of the replacement says you get to keep your rituals though.
Your book comes back completely blank
This is both the harshest and I think the least likely correct interpretation of the rules but for the sake of completeness I'll include it. The biggest strike against this reading is that you would lose the cantrips.
Your book comes back and you get new cantrips and rituals
You could argue that because you get a new Book of Shadow you have a new instance of the ability and gain new cantrips and the two free rituals. Again I don't think this is correct but it's not an unreasonable reading of the rules. The primary breaking point of this reading is that you could cycle through all the rituals and cantrips while having your wizard copy them down or just summon a new tome when you find yourself in need of a ritual you don't already have (it would functionally just take 1 hour and 10 minutes to cast instead of the 10 minutes).
Protecting your spells
If you are using the first interpretation (which we do at my table) there is no need to protect your spell as you will get them all back with your new book, otherwise there are a few ways to protect your spells, most are just ways to get copies of the spells in your book. Most require the help (paid for or otherwise) of a non-warlock character.
- Have the party wizard write them down - You can then "find" your lost rituals in their spellbook later.
- Pay another caster to make you a copy - Hand a wizard (or other spellbook casters) your Book of Shadows and a spellbook and they can make you a backup. They may even do so for free if you have spells that they don't (as they would get to copy the spells themselves).
- Make sure to keep everything that you find rituals on - If you find a spellbook and copy it into your Book of Shadows hang on to it so you can copy it again later.
- Keep your book in a lock box
- Glyph of Warding - attach a spell to your spellbook to prevent thievery or otherwise protect it
- Arcane Lock