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:
- Backup software and data
- Update database schema with provided update tool
Note: 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
- Backup the old Elastic SSO instance.
- Start the newer instance version of Elastic SSO.
- 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.
- 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.
- 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
- 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
- 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
- Run:
sudo migrate-database
and type in “yes” when prompted. - You have now successfully migrated to the newer version.
If Using External Database
- Backup the old Elastic SSO instance.
- Backup the database.
- In the new instance, login as super admin, set the credentials, and set the database connection.
-
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.
- SSH into the new Elastic SSO instance and run:
sudo migrate-database
and type in “yes” when prompted.- You have now successfully migrated to the newer version.