Just save two villagers in a safe place. Then they will rebreed if your village has died out.
Yea...But I haven't experienced Villagers repopulating an otherwise Dead Village.
Back when Horses were first introduced, I would be encountering Villages; then, after a few In-Game Days, those Villages would be Ghost Towns.
I then developed the practice of whenever I encounter a Village, I would use Sand Blocks (or Dirt Blocks or Gravel Blocks when I don't have Sand Blocks) to trap 2+ Villagers inside a Structure; until, all the Villagers were locked up.
In some Villages...I built a Village Spawning House (4 Doors per Side)...about 2 or 3 times, I built a 2-Story or 3-Story Village Spawning House. These Spawned Iron Golems.
I would then lure 2 Villagers into the Village Spawning House; then, lock them inside with Dirt Blocks.
In some Villager Spawning Houses, I built Escape Tunnels for the Villager Kids; while, the Monsters couldn't enter the Escape Tunnel Systems.
Since I started playing Hardcore only, I haven't encountered Villages alot; but, I still lock up Villagers inside Structures whenever possible; and, I make sure that all of the Village Structures are lit up and have Doors.
Having Monsters spawn inside Villager Occupied Structures defeats the purpose of locking up the Villagers in the first place. This had actually happened to me the last time, I had encountered a Village; and, it was a first for me.
If they all die and you spent a lot of time on a pimped out village then I dont see anything wrong with loading your map as creative, putting a couple eggs in your inventory and then reloading it as survival. Sure it is cheating, but until they give the villagers a less confusing spawn algorithm and less wanderlust, then I don't see this as bad.
Can you give me an idea (step by step) how to do this on my serverminer world? I have lost my villagers and this may be the only way to fix it.