All-optical regenerative memory for long term data storage