export xml files from one instance and import into another
[koha-eprints] / eprints-clone.sh
diff --git a/eprints-clone.sh b/eprints-clone.sh
new file mode 100755 (executable)
index 0000000..b87fcf3
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh -xe
+
+from=ffzg
+to=bibliografija
+
+bin="sudo -u eprints /usr/share/eprints3/bin"
+
+dir=/tmp/eprints-clone
+test -d $dir || mkdir $dir
+
+test -e $dir/$from.archive.xml || $bin/export $from archive XMLFiles > $dir/$from.archive.xml
+test -e $dir/$from.subject.xml || $bin/export $from subject XML      > $dir/$from.subject.xml
+test -e $dir/$from.user.xml    || $bin/export $from user    XML      > $dir/$from.user.xml
+
+#$bin/epadmin              erase_data $to
+#$bin/import          --verbose       $to user   XML $dir/$from.user.xml
+#$bin/import_subjects --verbose --xml $to            $dir/$from.subject.xml
+$bin/import          --verbose       $to eprint XML $dir/$from.archive.xml