Archivematica Storage Service 0.18.0 has not been released yet, and its documentation is a work in progress.

Migrating data from SQLite to MySQL

Storage Service supports both SQLite and MySQL databases. In most cases, it is preferably to use the latter since SQLite does not support concurrent writes. This is exarcerbated by the fact that Storage Service performs long write transactions.

Please find below an overview of the steps needed to move your data to MySQL. Make sure that you take a back up of your SQLite database before you proceed.

  1. Stop Storage Service:

    systemctl stop archivematica-storage-service
  2. Export your data to JSON:

    su - archivematica -s /bin/bash -c "set -a -e -x; source /etc/default/archivematica-storage-service; cd /usr/lib/archivematica/storage-service/; /usr/share/archivematica/virtualenvs/archivematica-storage-service/bin/python --exclude auth.permission --exclude contenttypes --exclude=sessions.session --natural-foreign --natural-primary --indent 4 dumpdata > /tmp/datadump.json"
  3. Create the MySQL database:

    CREATE DATABASE storage_service_test CHARACTER SET utf8 COLLATE utf8_general_ci;
  4. Grant privileges to the user:

    GRANT ALL PRIVILEGES ON storage_service_test.* TO 'username'@'localhost';
  5. Update the service configuration, e.g. in /etc/default/archivematica-storage-service, remove SS_DB_NAME and add instead the following:

  6. Create the MySQL tables:

    su - archivematica -s /bin/bash -c "set -a -e -x; source /etc/default/archivematica-storage-service; cd /usr/lib/archivematica/storage-service/; /usr/share/archivematica/virtualenvs/archivematica-storage-service/bin/python migrate"
  7. Load the JSON export:

    su - archivematica -s /bin/bash -c "set -a -e -x; source /etc/default/archivematica-storage-service; cd /usr/lib/archivematica/storage-service/; /usr/share/archivematica/virtualenvs/archivematica-storage-service/bin/python loaddata /tmp/datadump.json"
  8. Start Storage Service:

    systemctl start archivematica-storage-service