From 45dc9fc64566fe67b8ee3ab5426e48933d6dcfae Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Tue, 25 Oct 2022 02:25:00 +0100 Subject: [PATCH] implement restore-from-snapshot function in snapshot package. --- src/snapshot.lisp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/snapshot.lisp b/src/snapshot.lisp index b2d8f82..75b11ac 100644 --- a/src/snapshot.lisp +++ b/src/snapshot.lisp @@ -29,8 +29,10 @@ user can repopulate that database after they have restored this website. The (defun restore-from-snapshot (snapshot-name) "Deletes the data in /storage and the DB and replaces it with `SNAPSHOT-NAME'." - (format t "RESTORE-FROM-SNAPSHOT NOT IMPLEMENTED.")) - + (storage:remove-raw-directory "storage/") + (storage:remove-raw-directory "db/") + (storage:copy-raw-directory (format nil "snapshots/~a/storage/" snapshot-name) "storage/") + (storage:copy-raw-directory (format nil "snapshots/~a/db/" snapshot-name) "db/")) (defun delete-snapshot (snapshot-name) "Deletes the snapshot in the /snapshots directory with `SNAPSHOT-NAME'."