With or by good planning.
From "planning": the cognitive process of thinking about what you will do in the event of something happening
cf. luckily, often incorrectly used instead.
Planningly, when the server died (as servers do from time to time), we had a current backup. Luck had nothing to do with it.