from pathlib import Path import json R=Path(__file__).resolve().parent.parent P=R/'storage/app/private/investmoz-v2/portal-audit' old=(R/'tools/portal-service-followup-backup-qa.php').read_text(encoding='utf-8') new=old.replace('service-followup-backup-restoration-qa.json','consolidated-backup-restoration-qa.json') new=new.replace('service-followup-backups/','consolidated-backups/') new=new.replace("'workflow_service_restore_'","'workflow_consolidated_restore_'") (R/'tools/portal-consolidated-backup-qa.php').write_text(new,encoding='utf-8') print(json.dumps({'result':'prepared','scope':'New physical restoration of current 191-file QA source; historical restore proofs untouched','active_writes':0}))