optimizing backup/restore with valid JSON