EPrints 2.2 Documentation - Updating from Previous Versions |
Generally speaking when upgrading EPrints v2 you should unpack and install eprints to the same path as your current version. The installer will detect the existing version and upgrade it. Existing files which have been altered by you should be automatically backed up so they don't get lost. But if your hacks are important then you should probably back them up by hand before upgrading.
Always stop apache before upgrading.
Always make sure your system is fully backed up before upgrading.
Then you should follow the specific instructions for each stage from your old version to your new version...
A tool for assisting with this is available from http://software.eprints.org/files/
Too much of the configuration of the archive has changed to document individually. See
the CHANGELOG
file if you're really interested. If you have more than one
archive, then do each step for each one. Our example is the archive with the ID foobar.
To upgrade we suggest you use the UNIX diff
command to make a records of changes
you made to the archive config directory.
% diff /opt/eprints2/defaultcfg/ /opt/eprints2/archives/foobar/cfg/
Store the output from diff somewhere safe.
Remove /opt/eprints2/archives/foobar/cfg/
Now install eprints 2.0 and agree to upgrade when it asks.
Copy the new default configuration into your archive dir:
% cp -R /opt/eprints2/defaultcfg/ /opt/eprints2/archives/foobar/cfg/
Work through the ``diff'' you produced, and re-apply the changes
to the contents of /opt/eprints2/archives/foobar/cfg/
.
You also need to execute the following SQL command.
UPDATE document SET security='' WHERE security='public';
To connect to mysql via the command line run:
% mysql -u eprints foobar -p
And enter the database password for that archive.
Now re-run generate_apacheconf
and restart apache.
Upgrading from 2.0 should be less painful than this, the config files should change less dramatically from now on.
This release is mostly a bug fix release. There are a few bugs in the config files which you should fix by hand.
After upgrading EPrints, repeat these steps for the cfg directory of each archive you have created:
citations-en.xml
in the citation for poster, the year field is incorrecly named &years; rename it to &year;
ArchiveFreeTextIndexingConfig.pm
which meant
that ``return'' was treated as part of a word, rather than a word break. Unless you have modifed that file, just
replace it with the new one from /opt/eprints2/defaultcfg/
ArchiveRenderConfig.pm
- search for eprint_fieldname_abstract and add the following line as the next line:
$page->appendChild( $h2 );
These release fixes a few bugs but the main point is adding the subscriptions feature and support for OAI 2.0. See the NEWS file in the distribution for more information.
After upgrading EPrints, repeat these steps for each archive you have created:
% bin/upgrade ARCHIVEID
This script will explain the changes it is making. It will require the MySQL root password.
If you want an extra level of protection, you may want to run mysqldump to backup the database.
If you have already configured the OAI system then you need to add the required configuration for OAI 2.0. These can be copied from /opt/eprints2/defaultcfg/ArchiveOAIConfig.pm. The two relevant sections are the block titled ``OAI-PMH 2.0'' and the subroutine make_metadata_oai_dc_oai2
. Copy these into your archives ArchiveOAIConfig.pm and modify them if needed.
You need to add some more items to the cron tab to mail out the subscriptions. One set of new cron entries per archive.
new()
has changed the order of the parameters
(to standardise it with Subject, User, etc.).
In ArchiveRenderConfig.pm edit:
my $target = EPrints::EPrint->new( $session, $session->get_archive()->get_dataset( "archive" ), $eprint->get_value( "commentary" ) );
to be:
my $target = EPrints::EPrint->new( $session, $eprint->get_value( "commentary" ), $session->get_archive()->get_dataset( "archive" ) ) ;
(swapping the order of the last 2 parameters)
Upgrade eprints software to the new version then (for each archive)
% bin/upgrade ARCHIVEID
push @dcdata, [ "creator", EPrints::Utils::tree_to_utf8( EPrints::Utils::render_name( $session, $author, 0 ) ) ];
to this:
push @dcdata, [ "creator", EPrints::Utils::make_name_string( $author ) ];
$table->appendChild( _render_row( $session, $session->html_phrase( "eprint_fieldname_type" ), $eprint->render_value( "type" ) ) );
Change the block:
if( $security eq "staffonly" ) { # If you want to finer tune this, you could create # a new priv. and use that. return $user->has_priv( "editor" ); }
to:
if( $security eq "staffonly" ) { # If you want to finer tune this, you could create # new privs and use them.
# people with priv editor can read this document... if( $user->has_priv( "editor" ) ) { return 1; }
# ...as can the user who deposited it... if( $user->get_value( "userid" ) == $eprint->get_value( "userid" ) ) { return 1; }
# ...but nobody else can return 0;
}
$info->appendChild( $table );
Add:
my @subs = $user->get_subscriptions; my $subs_ds = $session->get_archive->get_dataset( "subscription" ); foreach my $subscr ( @subs ) { my $rowright = $session->make_doc_fragment; foreach( "frequency","spec","mailempty" ) { my $strong; $strong = $session->make_element( "strong" ); $strong->appendChild( $session->make_text( $subs_ds->get_field( $_ )->display_name( $session ) ) ); $strong->appendChild( $session->make_text( ": " ) ); $rowright->appendChild( $strong ); $rowright->appendChild( $subscr->render_value( $_ ) ); $rowright->appendChild( $session->make_element( "br" ) ); } $table->appendChild( _render_row( $session, $session->html_phrase( "page:subscription" ), $rowright ) );
}
To the end of <type name=``editor''>
<field name="editperms" staffonly="yes" /> <field name="frequency" required="yes" /> <field name="mailempty" required="yes" />
And to the end of <type name=``admin''>
<field name="editperms" /> <field name="frequency" required="yes" /> <field name="mailempty" required="yes" />
And then to ArchiveConfig.pm add (near ``subscription fields'' )
# Fields used for limiting the scope of editors $c->{editor_limit_fields} = [ "subjects", "type" ];
The additional 2 changes are required for GDOME support.
In ArchiveConfig.pm in sub get_entities change
$entities{ruler} = $archive->get_ruler()->toString; to $entities{ruler} = EPrints::XML::to_string( $archive->get_ruler() );
and in ruler.xml change the XML header to:
<?xml version="1.0" ?> <!DOCTYPE ruler >
get_dataset()
set_dataset()
Please use EPrints::XML::to_string( $node ) rather than $node->toString as in GDOME toString does not work as expected on DocumentFragments.
Now use: $db->get_values( $field, $dataset )
set_value()
EPrints 2.2 Documentation - Updating from Previous Versions |