Difference between revisions of "Moving a repository"
Line 1: | Line 1: | ||
+ | [[Category:Management]] | ||
{{ep2}} | {{ep2}} | ||
Revision as of 16:33, 8 February 2010
Please note! This page was written for EPrints version 2 and may not apply to version 3.
Moving an archive from one machine to another is a three-step process:
- Transfer Mysql Database
- Transfer Eprints Configuration Files
- Reconfigure The Archive On the New Machine
Note: All of these steps are performed from the NEW machine.
!!Transfer Mysql Database
Back up the Mysql database on the old machine.
shell> ssh 172.20.1.13 # you will be asked for the password shell> cd /root #run the following command from root directory shell> mysqldump -p --quick test1 | gzip > test1.old.gz shell> exit #leave the old server
Move the file to the new server and install it (do this as root).
Note: The eprints indexer should not be running
shell> sftp 172.20.1.13 #remote login to FTP sftp > get /root/test1.old.gz /root sftp > quit shell> bin/indexer stop # just in case it is running shell> mysqladmin -p create test1 shell> gunzip < /root/test1.old.gz | mysql -p test1 shell> mysql -p mysql> show databases; #test1 should be in the list mysql> quit shell> bin/indexer start
!!Transfer Eprints Configuration Files
Tar up files on old server (logged on as root).
shell> ssh 172.20.1.13 # you will be asked for the password shell> cd /opt/eprints2/archives shell> tar cvf test1.tar /opt/eprints2/archives/test1 shell> exit
Be sure you are logged onto the new server as root
shell> sftp 172.20.1.13 sftp > get /opt/eprints2/archives/test1.tar /opt/eprints2/archives sftp > get /opt/eprints2/archives/test1.xml /opt/eprints2/archives sftp > quit shell> cd / shell> ls -l /opt/eprints2/archives #check the ownership of files
If the files test1.tar and test1.xml are not owned by eprints, do the following:
shell> chown eprints:eprints /opt/eprints2/archives/test1.xml shell> chown eprints:eprints /opt/eprints2/archives/test1.xml
Log on or su to the eprints user and untar the file (be sure you are in the root (/) directory!):
shell> tar xvf /opt/eprints2/archives/test1.tar
!!Reconfigure The Archive On the New Machine
Move to the eprints2 directory.
shell> cd /opt/eprints2. #must be here to run following command shell> bin/configure_archive test1
Note1: As you go through configure_archive, be very sure that if you change any of the settings from the default you know what you are doing and why!
Note2: If you are going to use the same URL on the new machine as you did on the old one, do not forget to update your local DNS server to point the URL to the new server.
Note3: You will be asked if you want to create the database or archive files. You do not want to do that as they are already there.
shell> bin/generate_static test1
If you get an access denied error for the Mysql database, it is probably because the user has not been identified in Mysql. Add a new user (in this case, eprints is the new user) as follows:
shell> mysql -p #you will be prompted for the password mysql> grant all on test1.* to eprints@localhost; mysql> set password for eprints@localhost = password('eprints4ever'); mysql> quit
Once generate_static completes without errors, continue:
shell> bin/generate_abstracts test1 shell> bin/generate_views test1 shell> bin/generate_apacheconf
Do not forget to stop and start the apache server so the above changes can be applied.
Contributor
->Archie Trammell ->SIL International ->7500 W Camp Wisdom Road ->Dallas, TX USA ->archie_trammell@sil.org