Moving a repository

From EPrints Documentation
Revision as of 15:15, 18 May 2012 by Tdb01r (talk | contribs)
Jump to: navigation, search


Migrate the MySQL database

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'.

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

Migrate EPrints

Install the version of EPrints that you want to migrate to (e.g. you may want to upgrade).

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:

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

Migrate the 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.