Moving a repository

From EPrints Documentation
Revision as of 15:21, 18 May 2012 by Tdb01r (Talk | contribs)

Jump to: navigation, search


This Howto has been written for EPrints 3.3. You may need to adjust the instructions for earlier versions.

You will require your database name, username and password, which can be found in:

archives/[archiveid/cfg/cfg.d/database.pl

The remainder of this page assumes your database name and repository are called 'myrepo' and your database username and password are 'myrepo'/'XYXY'.

Migrate the MySQL database

Dump the MySQL database for the repository:

$ mysqldump --user=myrepo --password=XYXY myrepo | gzip > myrepo.sql.gz

Transfer the MySQL dump file to your new server e.g.:

$ scp myrepo.sql.gz user@mynewserver:/tmp

Create the MySQL database on the new server and give it the appropriate permissions:

$ mysql --user=root --password
{ root password }
mysql> create database myrepo;
mysql> grant all privileges on myrepo.* to myrepo@localhost identified by 'XYXY';

Load the database:

$ gunzip -c /tmp/myrepo.sql.gz | mysql --user=myrepo --password=XYXY myrepo

Install EPrints on the new server

Install the version of EPrints that you want to migrate to (e.g. you may want to upgrade). Take a note of the EPrints user and group, as you may need to re-assign the ownership of the transferred repository files.

Migrate the repository

Use tar and ssh to transfer your repository to the new server:

$ tar -czf - -C /opt/eprints3/archives myrepo/ | ssh user@mynewserver "tar -xzf - -C /opt/eprints3/archives"

Fix permissions and ownership:

$ sudo chown -R eprints:eprints /opt/eprints3/
$ sudo chmod -R 02775 /opt/eprints3/archives/

Migrate the repository's Apache configuration

If you have customised your Apache configuration you will need to transfer it:

$ scp /opt/eprints3/cfg/apache/myrepo.conf user@mynewserver:/opt/eprints3/cfg/apache/myrepo.conf
$ scp /opt/eprints3/cfg/apache_ssl/myrepo.conf user@mynewserver:/opt/eprints3/cfg/apache_ssl/myrepo.conf

Upgrading the repository

Skip if you installed the same EPrints version

$ ./bin/epadmin upgrade myrepo

Finishing

Make sure your repository is OK:

$ ./bin/epadmin test

For example you may need to install extra dependencies.

Generate any missing Apache configuration:

$ ./bin/generate_apacheconf

Restart Apache.

Optional you may - especially when upgrading - need to clear out static files:

$ rm -rf /opt/eprints3/archives/myrepo/html/*