How to update R and RStudio without breaking my configuration?

I want to update R and RStudio to current versions, but I have a book in progress and do not want to break its configuration. Is there a reliable set of steps to do this?

I guess it depends what you mean by "configuration".

Installed packages, mainly, I guess. My projects are dependent on those, and I suppose all else is covered by the .yml, .css, and .Rproj files?

What version of R/RStudio are you currently using and what system are you running it on (ie Windows, Mac, Linux)?