Introduction
It’s extremely easy to migrate Kepion applications from one environment to another. This article explains how system admins can migrate applications and set up the necessary permissions in the new environment.
Migrate database
1. Back up the database in SQL Server Management Studio in the source environment.
2. Restore the backup file to the target environment.
Tip: If migrating a database from a newer SQL instance to an older version, refer to this article for backup and restoration information.
3. Open Kepion and go to the System module.
4. Select Add.
5. Configure as follows:
- Option: Select Use existing application database.
- Server: Enter the name of your SQL server.
- Database: Select the target database.
Tip: If you can't discover any databases, refer to this troubleshooting article.
6. Select Add to finish.
Now you should be able to find your application in the application. If the application icon shows a green check mark, your application is online.
Permissions
When you migrate Kepion application databases from one environment to another, you need to ensure the Kepion SI and SSAS SI in the new environment have the right permissions.
For each application database, apply the following query in SQL Server Management Studio:
Note: Replace <KEPION_APPLICATION_DATABASE>, <KEPION_SI> and <SSAS_SI> with the appropriate context.
USE [<KEPION_APPLICATION_DATABASE>]
GO
IF NOT EXISTS (SELECT * FROM [sys].[database_principals] WHERE [type] = 'U' AND [name] = N'<KEPION_SI>')
BEGIN
CREATE USER [<KEPION_SI>] FOR LOGIN [<KEPION_SI>] WITH DEFAULT_SCHEMA = [dbo];
END;
ALTER USER [<KEPION_SI>] WITH DEFAULT_SCHEMA = [dbo];
IF NOT EXISTS (SELECT * FROM [sys].[database_principals] WHERE [type] = 'U' AND [name] = N'<SSAS_SI>')
BEGIN
CREATE USER [<SSAS_SI>] FOR LOGIN [<SSAS_SI>] WITH DEFAULT_SCHEMA = [dbo];
END;
ALTER USER [<SSAS_SI>] WITH DEFAULT_SCHEMA = [dbo];
EXEC sp_addrolemember N'db_datareader', N'<SSAS SI>'
EXEC sp_addrolemember N'db_owner', N'<KEPION_SI>'
Or you can manually map the Service Identities to each database through the User Mapping tab.
1. Right-click the login and select Properties.
2. Select db_owner for each database mapped to the Kepion SI and db_datareader for each one mapped to the SSAS SI. Ensure that the Default Schema for both is set to dbo.
Note: This process must be done for every database added to your environment after setup. For more information, refer to the Kepion Setup Guide.