Migrate Database to New Release

Elastic SSO Team Edition is a database-driven web application. Updates to the software will include schema changes. You will need to run the command line migrate script whenever you change your Elastic SSO instance to a newer revision. Warning: When upgrading to a newer version, you cannot use the Import/Export feature available under Administrator, Database Settings. The web interface for Import/Export is used for migrating from within the same version. You will instead need to manually export the existing database and import it into the new target database via mysqldump/mysql command line tools. Please use the following steps as a guideline for migration. If you are using an external database, please follow the corresponding directions. The basic idea is the following:
  1. Backup software and data
  2. Update database schema with provided update tool
The steps involved will vary depending on whether or not you have used the locally installed database or your own external database.

If Using Local Database

  1. Backup the old Elastic SSO instance.
  2. Start the newer instance version of Elastic SSO.
  3. For versions 3.0.8 and greater, skip this step. In the new instance, login as super admin, set the credentials, and set the database connection.
  4. DO NOT initialize the new database. This will cause the migration script to fail. If you have initialized the new database already, you can drop the database and recreate it via command line. If you are using version 3.0.8 or greater, you will need to drop the database since the versions come with a pre-initialized database. Alternatively, you can create a new database.
  5. SSH into the old Elastic SSO instance and obtain a mysqldump of the old database via command line. e.g.: mysqldump -u root -p elasticsso > /tmp/elasticsso.sql
  6. Copy over the dump file into the new Elastic SSO instance. This can be done via command line tool: scp /tmp/elasticsso.sql ec2-user@newinstanceip:/tmp
  7. SSH into the new Elastic SSO instance and import the file into the new instance’s database via command line. e.g.: mysql -u root -p elasticsso < elasticsso.sql
  8. Run: sudo migrate-database and type in “yes” when prompted.
  9. You have now successfully migrated to the newer version.

If Using External Database

  1. Backup the old Elastic SSO instance.
  2. Backup the database.
  3. In the new instance, login as super admin, set the credentials, and set the database connection.
  4. You will not need to initialize the database, since you have configured the new instance to point to the existing database. Note: You may notice some warnings/errors in the web interface. This is expected because the database has not been updated to the latest schema.
  5. SSH into the new Elastic SSO instance and run:
  6. sudo migrate-database and type in “yes” when prompted.
  7. You have now successfully migrated to the newer version.