What happens to the Bookshelf customisation when a Pet is abandoned or traded?

All books that Pet has read will stay with that Pet, but the items you used to customise your Bookshelf will be returned to your Bookshelf Inventory. You will not lose any customisation items when abandoning or transferring a Pet. This includes extra shelves!

When you adopt a Pet, the Bookshelf that comes with them will contain an inventory of all the books they’ve read (if any), but the Bookshelf itself will be reset to its default appearance.