How to migrate collection to main community ?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

How to migrate collection to main community ?

bhavesh
Dear All,

I want to migrate collection to main community.

Below is the current community and collection structure 

Community 1
   Collection 1_1
Community 2
   Collection 2_1
   Collection 2_2
community 3
   Collection 3_1

Now I want to create one seperate community for Collection 2_2 then 

how it's possible to make collection to main community ?

after migrating the collection to community the list should look like

Community 1
   Collection 1_1
Community 2
   Collection 2_1
community 3
   Collection 3_1
community 4  [ it's new from Collection_2_2 ]

Let me know if it's possible..

DSpace version 3.2


Thanks,
Bhavesh


Thanks & Regards,
Bhavesh R. Patel 
"Never leave till tomorrow which you can do today"
Please consider the environment before printing this e-mail.

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Thanks & Regards, Bhavesh Patel
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate collection to main community ?

helix84
Hi Bhavesh,

it is possible to change the parent of a community or to make it a
top-level community (i.e. no parent). For that, use community-filitor,
see [1].

However, two things are not possible (the second is the consequence of
the first):
1) You cannot have items directly under a community. Only collections
can contain items.
2) Therefore you cannot change a collection to a community.

This is not possible:

* Community 1
** Collection 1_1
*** item A
* community 4
** item B

This is possible:

* Community 1
** Collection 1_1
*** item A
* community 4
** Collection_2_2
*** item B


[1] https://wiki.duraspace.org/display/DSDOC3x/Managing+Community+Hierarchy


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate collection to main community ?

bhavesh
Dear helix84,

please see the current structure of our current IR.


See into that second community : IIMA Publications [8502] 

IIMA Publications [8502] --> IIMA In Media (collection)

Now I want to remove that collection and want to make one Top level community name as "IIMA In Media" and want to migrate the IIMA In Media collection under this new "IIMA In Media" Community.

Please let me know if it's possible.

Thanks,
Bhavesh



Thanks & Regards,
Bhavesh R. Patel 
"Never leave till tomorrow which you can do today"
Please consider the environment before printing this e-mail.


On Fri, Feb 14, 2014 at 5:18 PM, helix84 <[hidden email]> wrote:
Hi Bhavesh,

it is possible to change the parent of a community or to make it a
top-level community (i.e. no parent). For that, use community-filitor,
see [1].

However, two things are not possible (the second is the consequence of
the first):
1) You cannot have items directly under a community. Only collections
can contain items.
2) Therefore you cannot change a collection to a community.

This is not possible:

* Community 1
** Collection 1_1
*** item A
* community 4
** item B

This is possible:

* Community 1
** Collection 1_1
*** item A
* community 4
** Collection_2_2
*** item B


[1] https://wiki.duraspace.org/display/DSDOC3x/Managing+Community+Hierarchy


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Thanks & Regards, Bhavesh Patel
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate collection to main community ?

helix84
Is this the structure you want?

...
* IIMA Publications
** Annual Reports [48]
** Annual Reports of Indian Institute of Management, Ahmedabad
** Book Chapters [875]
** Book Chapters
** Books [480]
** Book Published by IIMA Faculty
** Cases and Notes [2262]
** Cases and Notes
** News on Indian Institute of Management
** Journal/Magazine Articles [2629]
** Journal/Magazine Article of IIM Ahmedabad
** Monographs [388]
** Newspaper Articles [749]
** Research Projects [855]
* IIMA In Media
** IIMA In Media
*** items
...

If this is what you want, then create the "IIMA In Media" community
and put its handle instead of "parentID":

[dspace]/bin/dspace community-filiator --set --parent=parentID
--child=123456789/11287


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate collection to main community ?

bhavesh
yes I want the same structure as you describe.

I have created one community called "IIMA In News"
and I have execute the command community-filiator as following :

[dspace]/bin/dspace community-filiator --set --parent=123456789/11734 --child=123456789/11287

But I got some error (please see the attached screen sort)

NOTE : This is of my local machine screen sort into that DSpace 4 version is installed (in window OS) and I have imported the DSpace3.2 database and update the database_schema on this for testing purpose.

What may be the problem of that command "Parent Community Can not Found" (See the screen sort and see the url below when I hover on that..) 

Thanks,
Bhavesh



Thanks & Regards,
Bhavesh R. Patel 
"Never leave till tomorrow which you can do today"
Please consider the environment before printing this e-mail.


On Fri, Feb 14, 2014 at 6:17 PM, helix84 <[hidden email]> wrote:
Is this the structure you want?

...
* IIMA Publications
** Annual Reports [48]
** Annual Reports of Indian Institute of Management, Ahmedabad
** Book Chapters [875]
** Book Chapters
** Books [480]
** Book Published by IIMA Faculty
** Cases and Notes [2262]
** Cases and Notes
** News on Indian Institute of Management
** Journal/Magazine Articles [2629]
** Journal/Magazine Article of IIM Ahmedabad
** Monographs [388]
** Newspaper Articles [749]
** Research Projects [855]
* IIMA In Media
** IIMA In Media
*** items
...

If this is what you want, then create the "IIMA In Media" community
and put its handle instead of "parentID":

[dspace]/bin/dspace community-filiator --set --parent=parentID
--child=123456789/11287


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

communiti-filiator-commad-error.jpg (78K) Download Attachment
Thanks & Regards, Bhavesh Patel
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate collection to main community ?

helix84


On Feb 15, 2014 5:14 AM, "Bhavesh Patel" <[hidden email]> wrote:
> [dspace]/bin/dspace community-filiator --set --parent=123456789/11734 --child=123456789/11287

This would have worked, but you used the short option syntax instead. Notice the absence of the equal sign in the short form:

[dspace]/bin/dspace community-filiator --set --parent=parentID --child=childID

[dspace]/bin/dspace community-filiator -s -p parentID -c childID


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate collection to main community ?

bhavesh
Okay,.. I have try it again..but it still not work.

see the below screen sort.. when I execute the following command

dspace community-filiator --set --parent=123456789/11734 --child=123456789/11287

Inline image 1

I have also try with short form using following command

dspace community-filiator -s -p=123456789/11734 -c=123456789/11287

Inline image 2

Note : I want to ask one more thing about that... I have not copy the assesstore folder of live I have just import and update the database schema. assesstore folder is require to do this community-filiator ?


Thanks & Regards,
Bhavesh R. Patel 
"Never leave till tomorrow which you can do today"
Please consider the environment before printing this e-mail.


On Sat, Feb 15, 2014 at 6:53 PM, helix84 <[hidden email]> wrote:


On Feb 15, 2014 5:14 AM, "Bhavesh Patel" <[hidden email]> wrote:
> [dspace]/bin/dspace community-filiator --set --parent=123456789/11734 --child=123456789/11287

This would have worked, but you used the short option syntax instead. Notice the absence of the equal sign in the short form:

[dspace]/bin/dspace community-filiator --set --parent=parentID --child=childID

[dspace]/bin/dspace community-filiator -s -p parentID -c childID



------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Thanks & Regards, Bhavesh Patel
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate collection to main community ?

helix84
On Mon, Feb 17, 2014 at 5:35 AM, Bhavesh Patel <[hidden email]> wrote:
Okay,.. I have try it again..but it still not work.
 
Sorry, my mistake. I forgot that community-filiator can't change the parent of a collection, only a community. The message says that the hande you gave it is a collection, not a community.

AFAIK, there is currently no user interface or CLI command in DSpace that can move a collection. But it's a simple operation - we'll do that in the database. First, you have to find out the IDs of the collection you want to move (CollectionID), the old community you want to move it from (OldCommunityID) and the new community you want to move it to (NewCommunityID), based on their handles.

All this is done from the psql command prompt (you asked about this recently). You should do a database backup first in case something gows wrong.

SELECT resource_id FROM handle WHERE handle = '123456789/11287';

So run the command above three times, once with each handle. Note the resulting resource_id and fill it into the command below:

UPDATE community2collection
SET community_id=NewCommunityID
WHERE community_id=OldCommunityID and collection_id=CollectionID;

Then you need to reindex.


Note : I want to ask one more thing about that... I have not copy the assesstore folder of live I have just import and update the database schema. assesstore folder is require to do this community-filiator ?

No, community-filiator doesn't touch the assetstore. It only changes the database.


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate collection to main community ?

bhavesh
Yes.. I have done as per your email.. And Now the Collection comes under my new Community.

But I think this query only change the parent id of collection.
and the rest of the relations related to collection to item and bundle will remain as it is..

So there may be the issue on community (item count)  it will still shows zero count. please see the screen sort
Inline image 1

I have execute the Itemcounter command but still not change the counter.

While updating into community2collection table it will change the parent id of collections. But there is some relation is also depend upon that count ..

I have checked with the following query (for the IIMA In Media collection)
SELECT count(*) as TOT FROM collection2item WHERE collection_id = '22' it's will give me [216]

Also there are some relation on the community2item table I have execute the query for IIMA Publication (resource_id is 8)
SELECT count(*) AS TOT FROM communities2item WHERE community_id = '8'

Inline image 2

So what I think is ...still we have to set(change) the community_id to new_created_community_id on this table (communities2item) with relation of item table.

I have execute the following query on item table for IIMA In News collection.
SELECT count(*) as TOT FROM item WHERE owning_collection = '22'

Inline image 3
Please let me know you comment on that..

Bhavesh


Thanks & Regards,
Bhavesh R. Patel 
"Never leave till tomorrow which you can do today"
Please consider the environment before printing this e-mail.


On Mon, Feb 17, 2014 at 2:33 PM, helix84 <[hidden email]> wrote:
On Mon, Feb 17, 2014 at 5:35 AM, Bhavesh Patel <[hidden email]> wrote:
Okay,.. I have try it again..but it still not work.
 
Sorry, my mistake. I forgot that community-filiator can't change the parent of a collection, only a community. The message says that the hande you gave it is a collection, not a community.

AFAIK, there is currently no user interface or CLI command in DSpace that can move a collection. But it's a simple operation - we'll do that in the database. First, you have to find out the IDs of the collection you want to move (CollectionID), the old community you want to move it from (OldCommunityID) and the new community you want to move it to (NewCommunityID), based on their handles.

All this is done from the psql command prompt (you asked about this recently). You should do a database backup first in case something gows wrong.

SELECT resource_id FROM handle WHERE handle = '123456789/11287';

So run the command above three times, once with each handle. Note the resulting resource_id and fill it into the command below:

UPDATE community2collection
SET community_id=NewCommunityID
WHERE community_id=OldCommunityID and collection_id=CollectionID;

Then you need to reindex.


Note : I want to ask one more thing about that... I have not copy the assesstore folder of live I have just import and update the database schema. assesstore folder is require to do this community-filiator ?

No, community-filiator doesn't touch the assetstore. It only changes the database.


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette



------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Thanks & Regards, Bhavesh Patel
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate collection to main community ?

helix84
You're right. DSpace 3 still uses the collection2item table. DSpace 4 doesn't use it anymore (by default, it reads the counts from Solr instead of the database).

You should be able to update it like this. Make sure to have a backup of the database because I haven't tested it in any way.

UPDATE community2item
SET community_id=NewCommunityID
WHERE item_id IN (SELECT item_id FROM collection2item WHERE collection_id = '22')

Update the index and run itemcounter afterwards


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate collection to main community ?

bhavesh
I have execute the command... It's update the community_id into community2item table 

see the screen sort after updating the community_id

Inline image 1

But after that it's not showing me the item counter 

I have update index and run itemcounter also. but it's still showing the older value. what may be the issue ?

Bhavesh

Thanks & Regards,
Bhavesh R. Patel 
"Never leave till tomorrow which you can do today"
Please consider the environment before printing this e-mail.


On Mon, Feb 17, 2014 at 4:47 PM, helix84 <[hidden email]> wrote:
You're right. DSpace 3 still uses the collection2item table. DSpace 4 doesn't use it anymore (by default, it reads the counts from Solr instead of the database).

You should be able to update it like this. Make sure to have a backup of the database because I haven't tested it in any way.

UPDATE community2item
SET community_id=NewCommunityID
WHERE item_id IN (SELECT item_id FROM collection2item WHERE collection_id = '22')

Update the index and run itemcounter afterwards


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette



------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Thanks & Regards, Bhavesh Patel
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate collection to main community ?

helix84
Did you try clearing the Cocoon cache? Other than that I have no idea right now.


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate collection to main community ?

bhavesh
Dear helix84,

Yes.. I have successfully migrate collection to other community.

Just I have execute the index-discovery -b command after UPDATE query.

Thanks for your help..

Bhavesh Patel

Thanks & Regards,
Bhavesh R. Patel 
"Never leave till tomorrow which you can do today"
Please consider the environment before printing this e-mail.


On Mon, Feb 17, 2014 at 6:19 PM, helix84 <[hidden email]> wrote:
Did you try clearing the Cocoon cache? Other than that I have no idea right now.


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
DSpace-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Thanks & Regards, Bhavesh Patel