export xml files from one instance and import into another
authordpavlin <dpavlin@eprints.ffzg.hr>
Tue, 29 Oct 2013 20:09:56 +0000 (21:09 +0100)
committerdpavlin <dpavlin@eprints.ffzg.hr>
Tue, 29 Oct 2013 20:09:56 +0000 (21:09 +0100)
eprints-clone.sh [new file with mode: 0755]

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