EPrints Technical Mailing List Archive

Message: #00182


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: Migrating data from 3.2 to 3.3


Hi,

Importing database records from 3.2.x to 3.3.y is NOT a good idea... If the DB schema has changed (note: it has), you'll be importing buggy data to your DB.

You may have to create a mirror of your repository and upgrade that instance, then switch over.

Seb.

On 13/03/12 17:06, M.D.Mcfarlane@lse.ac.uk wrote:
Hi All,

We're attempting to migrate (web_import) from a 3.2.5 instance to 3.3.8
instance of eprints.

We have a couple of issues - one is trying to migrate items which are
not publicly available - Tim has made a suggestion about this and we
will look at this in due course. The other is a bit more tricky -when we
try to import the whole repository some items that have documents
attached do not import. They fail with the following error:

Failed to create subdataobj on eprint.documents at
/usr/share/eprints3/bin/../perl_lib/EPrints/DataSet.pm line 1009

We tracked this down to the following sql:

Database execute debug: INSERT INTO `document` (`docid`) VALUES (?)

It seems that documents in 3.3 need more docids. In 3.2 we have a
document with the following:

+-------+----------+-----------------+----------------------------------
----------------------------------------+
| docid | eprintid | format          | formatdesc
|
+-------+----------+-----------------+----------------------------------
----------------------------------------+
| 16221 |    27861 | application/pdf | NULL
|
| 16222 |    27861 | image/jpeg      | Thumbnail Documents conversion
from application/pdf to thumbnail_preview |
| 16223 |    27861 | indexcodes      | Generate index codes conversion
from application/pdf to indexcodes       |
+-------+----------+-----------------+----------------------------------
----------------------------------------+

Whereas in 3.3 there is extra docs:

+-------+----------+-----------------+----------------------------------
----------------------------------+
| docid | eprintid | format          | formatdesc
|
+-------+----------+-----------------+----------------------------------
----------------------------------+
| 16221 |    27861 | application/pdf | NULL
|
| 16222 |    27861 | other           | Thumbnails conversion from
application/pdf to thumbnail_lightbox   |
| 16223 |    27861 | other           | Thumbnails conversion from
application/pdf to thumbnail_preview    |
| 16224 |    27861 | other           | Thumbnails conversion from
application/pdf to thumbnail_medium     |
| 16225 |    27861 | other           | Thumbnails conversion from
application/pdf to thumbnail_small      |
| 16226 |    27861 | other           | Generate index codes conversion
from application/pdf to indexcodes |
+-------+----------+-----------------+----------------------------------
----------------------------------+

  So documents are failing because they are duplicates.

Is there a simple way around this for importing records from a 3.2
repository into a 3.3? Also is there a best practice for the migrating
and upgrading instead of upgrading the live repo?

Cheers

Mike

Please access the attached hyperlink for an important electronic communications disclaimer: http://lse.ac.uk/emailDisclaimer

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/