You can use a serial-in parallel-out shift register like 74hc595. It requires a clock pulse, with latch input, and the last you need to send data in form of high and low with each clock pulse.
Remember you need to connect the output Enable pin to the ground permanently. So it's always in output enable mode.
Now you don't need any backup power supply. you just use these shift resisters normally when you have a proper power supply. you can give outputs to different bits of the shift register and also if you need more output pins you can add multiple shift registers.
Now let say you have set a few pins of the shift register to High state and rest to low.
Now you cut the power supply. and when you power back it will restore the last shifted value until you send new serial data to the register.
I don't know all the fancy stuff from datasheets but I have personally tested this thing with Shift Registers I am using 74hc595 IC in my test circuit.
And I am also attaching a test video to support my solution and if I am wrong then before saying that explain to me that how my test solution is working.