[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Re: Updating Subjects

Hi Eliseo,
There?s two sides to this:
- getting the new subjects created
- moving eprints from the old subjects to the new ones.

If possible, I?d look at getting the new subjects into order first ? as you?ve already identified, either via the web interface or the import (you might want to look at the subject export too ? which might be useful to do, add your new subjects and then re-import).
Creating a new set of nodes is (IMO) easier than trying to rework the existing ones as they are stored in the database as both child and parent trees, so you?d possibly have to make changes to stuff in all these tables:

To move the eprints from one node to another, if it?s a straight swap (e.g. subjectid_A is replaced by subjected_1; subjectid_B is replaced by subjectid_2 etc.), it?s fairly easy to do in the database (you could even clone the eprint_subjects table and do the updates in the new copy to be on the safe side).

mysql> UPDATE eprint_subjects SET subject = newSubjectID where subject = oldSubjectID;

I find the following query useful to see if there are any subjects use, but not defined:
mysql> select count(*),  subject, pos from eprint_subjects where subject NOT IN (select subjectid from subject) group by subject, pos;

Hope that helps a bit ? someone else might have some better/easier ways of doing this!

From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Eliseo Gatchalian
Sent: 17 March 2014 03:06
To: eprints-tech at ecs.soton.ac.uk
Subject: [EP-tech] Updating Subjects


I know that we can add and edit the subjects by logging in as admin and can also import a subject_xml file, but  If we are to merge some subjects with different subject code into one, is there an automatic way to update the subject codes for the items already submitted in the archive?

I saw the eprints_subject table wherein we can replace the subject field with the new codes and update the items but I?m not sure if there are anything else that we need to update?


Ellis Gatchalian
Systems Librarian
Private Bag 3036, Waikato Mail Centre, Hamilton 3240
Phone: +64-(0)7-834 8800 ext 8633
Fax: +64-(0)7-838 8257
Email: ellis.gatchalian at wintec.ac.nz<mailto:ellis.gatchalian at wintec.ac.nz>
Web: http://www.wintec.ac.nz/

[cid:image001.gif at 01CF41C0.EAF402A0]


This electronic mail transmission is intended for the named recipients only. It may contain private and confidential information. If this has come to you in error you must take no action based upon it, nor must you copy it or show it to anyone; please telephone or email the sender at Wintec immediately and return the original email. We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before opening any attachment which may be included with this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20140317/efab07c4/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 5148 bytes
Desc: image001.gif
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20140317/efab07c4/attachment.gif