- 09 Aug 2024
- 1 Minute to read
- Print
- PDF
URL Change Script
- Updated on 09 Aug 2024
- 1 Minute to read
- Print
- PDF
For URL Change scripts, perform URL changes by executing this script when setting up a new instance.
Update Vault details and DB connection string details by executing the script provided in the Plt_app_setting.
Select application_base_url,* from plt_application where application_base_url is not null.
For example, in the below SQL statements, update the changes as mentioned.
- Here existing URL is https://prodapexgi.symphonysummit.com/ in this URL replace "prodapexgi" with "Existingname"
- New URL is https://mssqldevbvt.symphonysummit.com in this replace "mssqldevbvt" with the new instance name.
Changes are to be made as per the requirements.
Execute the below SQL Statements in the restored Database.
UPDATE plt_serviceportal_Layout set Layout_Properties = REPLACE(Layout_Properties,'https://prodapexgi.symphonysummit.com/','https://mssqldevbvt.symphonysummit.com/') where serviceportal_unique_Id = 'b313a78d-316f-461e-a70f-db0fe320ad1e' GO UPDATE plt_application Set application_base_url = 'https://mssqldevbvt.symphonysummit.com' where application_base_url is not null GO If EXISTS(SELECT 1 FROM plt_menu_master WHERE unique_id='9c1a9a83-157f-4dcb-b30b-755bd2e4bf49' and view_unique_id is null) Begin update plt_menu_master set view_unique_id = 'c08e47f4-768d-4166-8fdb-787bbc9d7960' where unique_id = '9c1a9a83-157f-4dcb-b30b-755bd2e4bf49'; End GO UPDATE plt_serviceportal_Layout set Layout_Properties = REPLACE(Layout_Properties,'prodapexgi.symphonysummit.com','mssqldevbvt.symphonysummit.com') WHERE PATINDEX('%prodapexgi%',Layout_Properties) > 0 |
- Change the URL before executing as per the instance you are upgrading.
- Replace https://v2demophoenix.symphonysummit.com with the new instance URL.
IF EXISTS(select TOP 1 1 from plt_dynamicscriptdetails_version where typescript like '%https://prodapexgi.symphonysummit.com%') BEGIN update plt_dynamicscriptdetails_version set typescript = replace(typescript,'https://prodapexgi.symphonysummit.com','https://mssqldevbvt.symphonysummit.com') where typescript like '%https://prodapexgi.symphonysummit.com%' END IF EXISTS(select TOP 1 1 from plt_dynamicscriptdetails_version where typescript like '%https:///prodapexgi.symphonysummit.com%') BEGIN update plt_dynamicscriptdetails_version set typescript = replace(typescript,'https:///prodapexgi.symphonysummit.com','https:///mssqldevbvt.symphonysummit.com') where typescript like '%https:///prodapexgi.symphonysummit.com%' END IF EXISTS(select TOP 1 1 from plt_dynamicscriptdetails_version where typescript like '%http://prodapexgi.symphonysummit.com%') BEGIN update plt_dynamicscriptdetails_version set typescript = replace(typescript,'http://prodapexgi.symphonysummit.com','http://mssqldevbvt.symphonysummit.com') where typescript like '%http://prodapexgi.symphonysummit.com%' END |
DECLARE @NewURL NVARCHAR(500) ='https://mssqldevbvt.symphonysummit.com' /*
- Enter the new URL Path here. For example: https://mssqldevbvt.symphonysummit.com */
DECLARE @OldURL NVARCHAR(500) ='https://prodapexgi.symphonysummit.com' /*
- Enter the old URL Path here. For example: https://prodapexgi.symphonysummit.com */
UPDATE api SET api_url = REPLACE(REPLACE(REPLACE(REPLACE( api_url,@OldURL,@NewURL) ,'https://prodapexgi.symphonysummit.com',@NewURL) ,'https://itsmgiapi.symphonysummit.com',@NewURL) ,'https://localhost:44312',@NewURL) FROM plt_api_configuration api WHERE (api_url like '%'+ @OldURL+ '%' OR api_url like '%https://prodapexgi.symphonysummit.com%' OR api_url like '%https://itsmgiapi.symphonysummit.com%' OR api_url like '%https://localhost:44312%') |