Re: [dspace-tech] Failed to execute "dspace database migrated" because of duplicated rows in group2group table.

2017-07-06 Thread danielKim
Hi!
So your query just remove duplicated rows no matter ID attribute (what I 
was thinking)
The problem was solved. thanks a lot

2017년 7월 6일 목요일 오후 4시 20분 41초 UTC+8, Tom Desair (Atmire) 님의 말:
>
> Hi,
>
> Please try this:
>
>1. Take a backup of your database
>2. Before starting the Flyway migration (bin/dspace database migrate) 
>execute these two SQL statements on your database:
>   - delete from group2group where id in (select id from group2group 
>   g1 where exists (select 1 from group2group g2 where g2.parent_id = 
>   g1.parent_id and g2.child_id = g1.child_id and g2.id < g1.id));
>   - delete from epersongroup2eperson where id in (select id from 
>   epersongroup2eperson g1 where exists (select 1 from 
> epersongroup2eperson g2 
>   where g2.eperson_group_id = g1.eperson_group_id and g2.eperson_id = 
>   g1.eperson_id and g2.id < g1.id));
>   3. Run the Flyway migration and start Tomcat
>
> Best regards,
> Tom
>
>  
> [image: logo] Tom Desair
> 250-B Suite 3A, Lucius Gordon Drive, West Henrietta, NY 14586
> Gaston Geenslaan 14, Leuven 3001, Belgium
> www.atmire.com 
> 
>
> 2017-07-05 9:56 GMT+02:00 danielKim >:
>
>> Thanks for watching this question.
>> I am migrating old server which is running dspace 6.0 to new server which 
>> is running CRIS dspace 6.0
>> So far I have done "mvn package" and "ant fresh_install" successfully.
>> After that, I backup database from the old server use pg_dump and restore 
>> it in a new server using psql -f backupfile command.
>>
>> And then, I started the tomcat9 service and it is failed to start service 
>> I guess this is database problem.
>> I stopped tomcat9 service and try to run command "[dspace]/bin/dspace 
>> database info" and I got the following result.
>>
>>
>> ++-+-+-+
>> | Version| Description | 
>> Installed on| State   |
>>
>> ++-+-+-+
>> | 1.1| Initial DSpace 1.1 database schema  | 
>> | > | 1.2| Upgrade to DSpace 1.2 schema| 
>> | > | 1.3| Upgrade to DSpace 1.3 schema| 
>> | > | 1.3.9  | Drop constraint for DSpace 1 4 schema   | 
>> | > | 1.4| Upgrade to DSpace 1.4 schema| 
>> | > | 1.5| Upgrade to DSpace 1.5 schema| 
>> | > | 1.5.9  | Drop constraint for DSpace 1 6 schema   | 
>> | > | 1.6| Initializing from DSpace 1.6 database schema| 
>> 2017-07-05 15:39:55 | Success |
>> | 1.7| Upgrade to DSpace 1.7 schema| 
>> 2017-07-05 15:39:55 | Success |
>> | 1.8| Upgrade to DSpace 1.8 schema| 
>> 2017-07-05 15:39:55 | Success |
>> | 1.8.2.0| DSpaceCRIS-crismodule database schema   | 
>> 2017-07-05 15:39:56 | Success |
>> | 1.8.2.1| DSpaceCRIS-crispubmed database schema   | 
>> 2017-07-05 15:39:58 | Success |
>> | 1.8.2.2| DSpaceCRIS-subscription database schema | 
>> 2017-07-05 15:39:58 | Success |
>> | 3.0| Upgrade to DSpace 3.x schema| 
>> 2017-07-05 15:39:58 | Success |
>> | 3.2.1.0| DSpaceCRIS-Upgrade-crismodule 182 to 321| 
>> 2017-07-05 15:39:58 | Success |
>> | 4.0| Upgrade to DSpace 4.x schema| 
>> 2017-07-05 15:39:58 | Success |
>> | 4.1.0.0| DSpaceCRIS-Upgrade-crismodule 321 to 4  | 
>> 2017-07-05 15:39:59 | Success |
>> | 4.3.0.0| DSpaceCRIS-Upgrade-crismodule 4 to 43   | 
>> 2017-07-05 15:39:59 | Success |
>> | 4.9.2015.10.26 | DS-2818 registry update | 
>> 2017-07-05 15:39:59 | Success |
>> | 5.0.2014.08.08 | DS-1945 Helpdesk Request a Copy | 
>> 2017-07-05 15:39:59 | Success |
>> | 5.0.2014.09.25 | DS 1582 Metadata For All Objects drop constraint| 
>> 2017-07-05 15:39:59 | Success |
>> | 5.0.2014.09.26 | DS-1582 Metadata For All Objects| 
>> 2017-07-05 15:39:59 | Success |
>> | 5.3.0.0| DSpaceCRIS-Upgrade-crismodule 5 to 53   | 
>> 2017-07-05 15:40:07 | Success |
>> | 5.3.0.1| FIX-SNAPSHOT-DSpaceCRIS-Upgrade-crismodule 5 to 53  | 
>> 2017-07-05 15:40:07 | Success |
>> | 5.3.0.2| DSpaceCRIS-Upgrade-crismodule 5 to 53   | 
>> 2017-07-05 15:40:07 | Success |
>> | 5.3.0.3| DSpaceCRIS-Upgrade-crismodule 5 to 53

Re: [dspace-tech] Failed to execute "dspace database migrated" because of duplicated rows in group2group table.

2017-07-06 Thread Tom Desair
Hi,

Please try this:

   1. Take a backup of your database
   2. Before starting the Flyway migration (bin/dspace database migrate)
   execute these two SQL statements on your database:
  - delete from group2group where id in (select id from group2group g1
  where exists (select 1 from group2group g2 where g2.parent_id =
  g1.parent_id and g2.child_id = g1.child_id and g2.id < g1.id));
  - delete from epersongroup2eperson where id in (select id from
  epersongroup2eperson g1 where exists (select 1 from
epersongroup2eperson g2
  where g2.eperson_group_id = g1.eperson_group_id and g2.eperson_id =
  g1.eperson_id and g2.id < g1.id));
  3. Run the Flyway migration and start Tomcat

Best regards,
Tom


[image: logo] Tom Desair
250-B Suite 3A, Lucius Gordon Drive, West Henrietta, NY 14586
Gaston Geenslaan 14, Leuven 3001, Belgium
www.atmire.com


2017-07-05 9:56 GMT+02:00 danielKim :

> Thanks for watching this question.
> I am migrating old server which is running dspace 6.0 to new server which
> is running CRIS dspace 6.0
> So far I have done "mvn package" and "ant fresh_install" successfully.
> After that, I backup database from the old server use pg_dump and restore
> it in a new server using psql -f backupfile command.
>
> And then, I started the tomcat9 service and it is failed to start service
> I guess this is database problem.
> I stopped tomcat9 service and try to run command "[dspace]/bin/dspace
> database info" and I got the following result.
>
> ++--
> ---+-+-+
> | Version| Description |
> Installed on| State   |
> ++--
> ---+-+-+
> | 1.1| Initial DSpace 1.1 database schema  |
>   |  | 1.2| Upgrade to DSpace 1.2 schema|
>   |  | 1.3| Upgrade to DSpace 1.3 schema|
>   |  | 1.3.9  | Drop constraint for DSpace 1 4 schema   |
>   |  | 1.4| Upgrade to DSpace 1.4 schema|
>   |  | 1.5| Upgrade to DSpace 1.5 schema|
>   |  | 1.5.9  | Drop constraint for DSpace 1 6 schema   |
>   |  | 1.6| Initializing from DSpace 1.6 database schema|
> 2017-07-05 15:39:55 | Success |
> | 1.7| Upgrade to DSpace 1.7 schema|
> 2017-07-05 15:39:55 | Success |
> | 1.8| Upgrade to DSpace 1.8 schema|
> 2017-07-05 15:39:55 | Success |
> | 1.8.2.0| DSpaceCRIS-crismodule database schema   |
> 2017-07-05 15:39:56 | Success |
> | 1.8.2.1| DSpaceCRIS-crispubmed database schema   |
> 2017-07-05 15:39:58 | Success |
> | 1.8.2.2| DSpaceCRIS-subscription database schema |
> 2017-07-05 15:39:58 | Success |
> | 3.0| Upgrade to DSpace 3.x schema|
> 2017-07-05 15:39:58 | Success |
> | 3.2.1.0| DSpaceCRIS-Upgrade-crismodule 182 to 321|
> 2017-07-05 15:39:58 | Success |
> | 4.0| Upgrade to DSpace 4.x schema|
> 2017-07-05 15:39:58 | Success |
> | 4.1.0.0| DSpaceCRIS-Upgrade-crismodule 321 to 4  |
> 2017-07-05 15:39:59 | Success |
> | 4.3.0.0| DSpaceCRIS-Upgrade-crismodule 4 to 43   |
> 2017-07-05 15:39:59 | Success |
> | 4.9.2015.10.26 | DS-2818 registry update |
> 2017-07-05 15:39:59 | Success |
> | 5.0.2014.08.08 | DS-1945 Helpdesk Request a Copy |
> 2017-07-05 15:39:59 | Success |
> | 5.0.2014.09.25 | DS 1582 Metadata For All Objects drop constraint|
> 2017-07-05 15:39:59 | Success |
> | 5.0.2014.09.26 | DS-1582 Metadata For All Objects|
> 2017-07-05 15:39:59 | Success |
> | 5.3.0.0| DSpaceCRIS-Upgrade-crismodule 5 to 53   |
> 2017-07-05 15:40:07 | Success |
> | 5.3.0.1| FIX-SNAPSHOT-DSpaceCRIS-Upgrade-crismodule 5 to 53  |
> 2017-07-05 15:40:07 | Success |
> | 5.3.0.2| DSpaceCRIS-Upgrade-crismodule 5 to 53   |
> 2017-07-05 15:40:07 | Success |
> | 5.3.0.3| DSpaceCRIS-Upgrade-crismodule 5 to 53   |
> 2017-07-05 15:40:07 | Success |
> | 5.3.0.4| DSpaceCRIS-Upgrade-crismodule 5 to 53   |
> 2017-07-05 15:40:07 | Success |
> | 5.3.0.5| DSpaceCRIS-Upgrade-crismodule 5 to 53   |
> 2017-07-05 15:40:07 | Success |
> | 5.3.0.6| DSpaceCRIS-Upgrade-crismodule 5 to 53   |
> 2017-07-05 15:40:08 |