Difference between revisions of "Moving a repository"
Line 1: | Line 1: | ||
[[Category:Management]] | [[Category:Management]] | ||
− | = | + | ==Migrate the MySQL database== |
+ | You will require your database username, password and name, which can be found in: | ||
+ | archives/[archiveid/cfg/cfg.d/database.pl | ||
− | + | 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 -u root -p | |
+ | { 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 | + | 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. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 15:12, 18 May 2012
Contents
Migrate the MySQL database
You will require your database username, password and name, which can be found in:
archives/[archiveid/cfg/cfg.d/database.pl
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 -u root -p { 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.