8 bin="time sudo -u eprints $ep/bin"
10 dir=/tmp/eprints-clone
11 test -d $dir || mkdir $dir
13 # select just one export
14 if [ ! -e $dir/$from.archive.xml ] ; then
15 # wd don't want files embedded in XML
16 #$bin/export $from archive XMLFiles > $dir/$from.archive.xml
17 $bin/export $from archive XML > $dir/$from.archive.xml
19 test -e $dir/$from.archive.xml ||
21 test -e $dir/$from.subject.xml || $bin/export $from subject XML > $dir/$from.subject.xml
22 test -e $dir/$from.user.xml || $bin/export $from user XML > $dir/$from.user.xml
24 if $bin/epadmin test $to ; then
25 echo "$to exists, skip import"
27 echo "$to import from $from started"
30 $bin/epadmin create $to
32 cd /usr/share/eprints3/archives/$to/cfg
35 git commit -m "new repository $to"
37 rsync -rv $ep/archives/$from/cfg/ $ep/archives/$to/cfg/
39 echo "restore core configuration of $to"
40 git diff cfg.d/adminemail.pl | patch -R -p1
41 git diff cfg.d/10_core.pl | patch -R -p1
42 git diff lang/en/phrases/archive_name.xml | patch -R -p1
44 git diff cfg.d/database.pl | patch -R -p1
46 git commit -m "$from configuration changes" -a
48 echo "Modify databse for $from shema"
49 $bin/epadmin update $to
51 #$bin/epadmin erase_data $to
53 echo "Importing data to $to"
54 $bin/import $to user XML $dir/$from.user.xml
55 $bin/import_subjects --xml $to $dir/$from.subject.xml
56 $bin/import --enable-web-imports $to eprint XML $dir/$from.archive.xml
58 $bin/generate_static $to
59 $bin/generate_views $to
60 $bin/generate_abstracts $to