On how much notice, from the receiving end of a two week shutdown that was genuinely disruptive: more than you think, and much more for anything a business depends on.
Rough guidance:
A consumer tool: a couple of months is decent.
Anything a business uses in its workflow - three months minimum, because they have to find a replacement, migrate, and retrain people, and none of that is at the top of anybody's list.
Anything integrated into other systems - longer, because somebody has to write code.
Four years of accumulated data pushes it towards the longer end, since exporting and rebuilding elsewhere is real work for them.
What made the shutdown I lived through bad was not the closure. It was two weeks notice, an export that only produced part of the data, and no reply to questions. Any one of those fixed would have made it fine.
What helps enormously and costs nothing: name a replacement. Even better, help people move: a migration guide, or an export in a format the obvious alternative can import. People remember that, and if you build something else later they will turn up.
And answer the emails. The volume is smaller than you fear and silence is what turns disappointment into resentment.