From 87a0db4ffe01bd556a18a9f85e80a522b4663b92 Mon Sep 17 00:00:00 2001 From: joshdentremont Date: Thu, 23 Nov 2023 11:13:17 -0400 Subject: [PATCH 1/2] added new make commands for importing and exporting in fedora 6 Renamed the old commands to fcrepo5-import and fcrepo5-export --- Makefile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3f8ef1da2..c551b1ab9 100644 --- a/Makefile +++ b/Makefile @@ -417,6 +417,25 @@ endif # Dump fcrepo as zipped tarball fcrepo-export: +ifndef DEST + $(error DEST is not set) +endif + docker compose exec -T fcrepo with-contenv bash -lc 'tar zcvf fcrepo-export.tgz -C /data/home/data/ocfl-root/ .' + docker compose exec -T fcrepo with-contenv bash -lc 'mv fcrepo-export.tgz /tmp' + docker cp $$(docker compose ps -q fcrepo):/tmp/fcrepo-export.tgz $(DEST) + + +# Import fcrepo from zipped tarball +fcrepo-import: $(SRC) +ifndef SRC + $(error SRC is not set) +endif + docker cp "$(SRC)" $$(docker compose ps -q fcrepo):/tmp/fcrepo-export.tgz + docker compose exec -T fcrepo with-contenv bash -lc 'tar zxvf /tmp/fcrepo-export.tgz -C /data/home/data/ocfl-root/ && chown -R tomcat:tomcat /data/home/data/ocfl-root/ && rm /tmp/fcrepo-export.tgz' + + +# Dump fcrepo as zipped tarball +fcrepo5-export: ifndef DEST $(error DEST is not set) endif @@ -426,7 +445,7 @@ endif # Import fcrepo from zipped tarball -fcrepo-import: $(SRC) +fcrepo5-import: $(SRC) ifndef SRC $(error SRC is not set) endif From 787e2b97ac6dff55351c873e6bb9db4b98de5aa0 Mon Sep 17 00:00:00 2001 From: joshdentremont Date: Fri, 16 Feb 2024 11:01:38 -0400 Subject: [PATCH 2/2] Update fcrepo import process --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index c551b1ab9..5497455ce 100644 --- a/Makefile +++ b/Makefile @@ -431,7 +431,10 @@ ifndef SRC $(error SRC is not set) endif docker cp "$(SRC)" $$(docker compose ps -q fcrepo):/tmp/fcrepo-export.tgz + docker compose exec -T fcrepo with-contenv bash -lc 'rm -r /data/home/data/ocfl-root/*' docker compose exec -T fcrepo with-contenv bash -lc 'tar zxvf /tmp/fcrepo-export.tgz -C /data/home/data/ocfl-root/ && chown -R tomcat:tomcat /data/home/data/ocfl-root/ && rm /tmp/fcrepo-export.tgz' + docker compose exec -T mariadb with-contenv bash -lc 'mysql -e "drop database fcrepo;"' + docker compose restart fcrepo # Dump fcrepo as zipped tarball