8 bin="time sudo -u eprints $ep/bin"
10 dir=/tmp/eprints-clone
11 test -d $dir || mkdir $dir
13 test -e $dir/$from.archive.xml || $bin/export $from archive XMLFiles > $dir/$from.archive.xml
14 #test -e $dir/$from.no-files.xml || $bin/export $from archive XML > $dir/$from.no-files.xml
15 test -e $dir/$from.subject.xml || $bin/export $from subject XML > $dir/$from.subject.xml
16 test -e $dir/$from.user.xml || $bin/export $from user XML > $dir/$from.user.xml
18 if $bin/epadmin test $to ; then
19 echo "$to exists, skip import"
21 echo "$to import from $from started"
24 $bin/epadmin create $to
26 cd /usr/share/eprints3/archives/$to/cfg
29 git commit -m "new repository $to"
31 rsync -rv $ep/archives/$from/cfg/ $ep/archives/$to/cfg/
33 echo "restore core configuration of $to"
34 git diff cfg.d/adminemail.pl | patch -R -p1
35 git diff cfg.d/10_core.pl | patch -R -p1
36 git diff lang/en/phrases/archive_name.xml | patch -R -p1
38 git diff cfg.d/database.pl | patch -R -p1
40 git commit -m "$from configuration changes" -a
42 echo "Modify databse for $from shema"
43 $bin/epadmin update $to
45 #$bin/epadmin erase_data $to
47 echo "Importing data to $to"
48 $bin/import --verbose $to user XML $dir/$from.user.xml
49 $bin/import_subjects --verbose --xml $to $dir/$from.subject.xml
50 $bin/import --verbose $to eprint XML $dir/$from.archive.xml