You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
an initial licenses creation sql can be created by using the upgraded database with something like:
# on "pump machine"
sudo -u postgres pg_dump -t license_label -t license_label_extended_mapping -t license_definition --data-only --column-inserts dspace | sed -e '/public.license_label_extended_mapping/s#mapping_id,##;/public.license_label_extended_mapping/s#VALUES ([0-9]*,#VALUES (#' | grep -v "setval('public.license_label_extended_mapping_mapping_id_seq'" | awk 'BEGIN{print("BEGIN;");print("insert into user_registration(user_registration_id) select i from (values (4),(5),(20),(84)) as X(i);")} END{print("update public.license_definition set user_registration_id = 1;");print("DELETE FROM public.user_registration where user_registration_id >1;");print("COMMIT;")} {print}' | gzip > /tmp/license_labels.sql.gz
#scp
# on fresh machine
zcat /tmp/license_labels.sql.gz | sudo -u postgres psql dspace
what it does:
dump the relevant tables
remove the mapping_id (values) from the license_label_extended_mapping, so they get autogenerated
remove the sequence update
modify the sql so it runs inside a transaction
create temporary user registrations (we need the ids used in the dump)
update all the license definitions so they appear to be created by eperson with id 1 (should be admin)
delete all user registrations != 1 (ie. the temporary ones)
So it should be run in more or less empty system (because of the user registration inserts/deletes); I guess one might start from the dump and edit manually...
Fresh install should contain at least the licenses available in open license selector
The text was updated successfully, but these errors were encountered: