Child pages
  • Migrating from Derby to PostgreSQL

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Log onto checksumdb and ingest data (and fix the automated sequences)

  • \c checksumdb
  • COPY checksums FROM '/path/to/checksums' with csv;
  • SELECT SETVAL('checksums_guid_seq', (SELECT MAX(guid) FROM checksums));

Log onto auditdb and ingest data (and fix the automated sequences)

  • \c auditdb
  • COPY actor FROM '/path/to/actors' with csv;
  • COPY file FROM '/path/to/files' with csv;
  • COPY audittrail FROM '/path/to/audittrails' with csv;
  • SELECT SETVAL('file_file_guid_seq', (SELECT MAX(file_guid) FROM file));

  • SELECT SETVAL('actor_actor_guid_seq', (SELECT MAX(actor_guid) FROM actor));

  • SELECT SETVAL('audittrail_sequence_number_seq', (SELECT MAX(sequence_number) FROM audittrail));

...

Migrating service databases

...

That should make 2 files: 'alarm_component' og 'alarm_alarm'.
Run in 'psql':   - >

  • \c alarmdb

...

  • COPY component FROM '/path/to/alarm_component' with csv;

...

  • COPY alarm FROM '/path/to/alarm_alarm' with csv;
  • SELECT SETVAL('alarm_guid_seq', (SELECT MAX(guid) FROM alarm));
  • SELECT SETVAL('component_component_guid_seq', (SELECT MAX(component_guid) FROM component));

Export/Import data for AuditTrailService

...

  • \c auditservicedb
  • COPY actor FROM '/path/to/audit_actor' with csv;
  • COPY contributor FROM '/path/to/audit_contributor' with csv;
  • COPY collection FROM '/path/to/audit_collection' with csv;
  • COPY preservation FROM '/path/to/audit_preservation' with csv;
  • COPY file FROM '/path/to/audit_file' with csv;
  • COPY audittrail FROM '/path/to/audit_audittrail' with csv;
  • SELECT SETVAL('preservation_preservation_key_seq', (SELECT MAX(preservation_key) FROM preservation));

  • SELECT SETVAL('file_file_key_seq', (SELECT MAX(file_key) FROM file));
  • SELECT SETVAL('contributor_contributor_key_seq', (SELECT MAX(contributor_key) FROM contributor));

  • SELECT SETVAL('collection_collection_key_seq', (SELECT MAX(collection_key) FROM collection));
  • SELECT SETVAL('audittrail_audit_key_seq', (SELECT MAX(audit_key) FROM audittrail));

  • SELECT SETVAL('actor_actor_key_seq', (SELECT MAX(actor_key) FROM actor));

Export/Import data for AuditTrailContributor databasen for IntegrityService

...

  • \c integrity_auditdb
  • COPY actor FROM '/path/to/integrity_audit_actors' with csv;
  • COPY file FROM '/path/to/integrity_audit_files' with csv;
  • COPY collection FROM '/path/to/integrity_audit_collection' with csv;
  • SELECT SETVAL('file_file_guid_seq', (SELECT MAX(file_guid) FROM file));

  • SELECT SETVAL('actor_actor_guid_seq', (SELECT MAX(actor_guid) FROM actor));

  • SELECT SETVAL('audittrail_sequence_number_seq', (SELECT MAX(sequence_number) FROM audittrail));