Update Analytics from v. 2023.3 to Analytics v. 2023.4 with LS Central SaaS
Analytics customers using Analytics SaaS can continue using the current and older versions of Analytics even if LS Central SaaS is updated to version 23.0, because the Data Director uses web services to replicate the data and can differentiate between the old and the new companion table structure. Our future Analytics for LS Central SaaS updates will, however, always assume that the new companion table structure is being used, so we highly recommend updating Analytics to version 2023.4. You can do that by following the update guidelines and merge data from current tables into the new ones, or, if you have a low-volume database, the simplest approach would be to create a new Analytics instance and replicate all data over to the new instance again.
If you have high-volume data (20 million transaction lines or more) and are running a version of Analytics older than 2023.3, you can still apply only version 2023.4 update package to get the support for Analytics for LS Central 23.0, but this will not apply any functional updates from the version you were running to version 2023.4. To get those you need to update to version 2023.3 before updating to 2023.4, one version at a time. Future functional updates will, however, be available to all that have updated to version 2023.4 and the new companion table structure. To get a full functional update, you can always create a new instance of Analytics and re-replicate the data into the new instance, or get assistance from LS Retail Consulting to move data between Analytics databases.
The update package includes the bicep files to update the ADF and scripts to modify the database tables. You can read more about the updates in the release notes for this version. The change to the Query base pipeline, database, and the scripts to merge data will also be included in the next functional update of Analytics.
Tip: If you have a large number of customizations, we recommend that you set up a new Analytics instance with new DW and ADF beside the older instance of Analytics, and move your customizations between them before you start using the new instance.
Download update
Use the link you received from LS Retail Licenses to access the download form and request an update package.
When you have entered the relevant information to the form and submitted, you will receive an email with a download link to a zip file that includes everything you need.
Preparation
Before you run the Update script, you must disable the Scheduled Run trigger in the Analytics instance you want to update. If you view the instructions on how to activate the trigger, you can follow those, but this time you set Activated to No and then apply and publish the changes.
Update Analytics for LS Central
- Open the update package folder you just downloaded, in VS Code or navigate to the update folder in your PowerShell client.
- To open the whole folder in VS Code, open it in File Explorer and then right-click in a white space, not a file, and select Open with Code.
- In order to install bicep, we have added a PowerShell script with code from Microsoft learn, InstallBicep.ps1. You will need to run this script once.
- Open the UpdateAnalytics.ps1 script in VS Code, and run by clicking F5. Or run the script from PowerShell.
- The script will first ask if you have access to the file path to the parameter file (Parameters.json) that is located in the Analytics project folder that was created when Analytics was deployed (YYYYMMDDHHMM-MyProject).
- If you still have access to the project folder, you can reuse the parameters by answering Yes and providing the full path to the Parameters.json file.
- If the project folder has been removed or deleted, you just answer No and enter the parameters when prompted.
Note: You need to use the same parameters you supplied when you installed Analytics. You can find the connection parameters and the names of your current SQL server, database, and Azure Data Factory in the Azure portal.
- The script then prompts for Azure subscription ID and login to Azure.
- Next, the script collects the parameters that have not been set, and validates connection parameters to LS Central and Analytics.
- The script now runs the updates.
- When the script has finished running, it displays a message.
This update has now prepared the Analytics system and Query base creation pipeline to handle the new table structure in LS Central 23.0, where there are no longer several companion tables but only one table with suffix $ext.
Migration of data - optional
After you update, you now have the choice to run two additional scripts on the Analytics database. The scripts are a part of the update package, located in the BC23 Migration folder.
- Step1_Analytics_BC23_create_new_ext_tables.ps1
- Step2_Analytics_BC23_upgrade data.ps1
These scripts create a connection to the Analytics database, change the pre-staging tables to the new LS Central 23.0 table structure (Step 1) and merge the data that has already been replicated from the older pre-staging table structure to the new one (Step 2). By doing this you are prepared for adding additional extensions and customizations to the data warehouse based on the new LS Central table structure.
At any time after you have updated your LS Central SaaS environment to version 23.0 you can at your discretion follow the steps below to update the pre-staging tables and merge the data to the new tables:
- Stop all replication to the Analytics database.
- Update Data Director to version 3.02.140 or later, if you have not done so already. You can find the new DD on the LS Retail Portal (login required).
- Stop the Daily scheduled run trigger in the Azure data Factory.
- Open PowerShell ISE as administrator and from there:
- Navigate to the Update Package BC23 Migration folder.
- Run the following: Install-Module -Name SqlServer -AllowClobber.
- Run: Step1_Analytics_BC23_create_new_ext_tables.ps1 (write Step1 and press tab).
- Check that the new tables with suffix $ext have been created in the Analytics database.
- If you have been using columns from other extensions to BC than LSC and LSCHT, those columns will not be present in the newly created companion tables, so you will have to add them manually before you continue, and the same applies if you have been using new extension tables from other extensions. Then you will need to create these new tables before you continue with the data merge. The process of creating new columns and tables is explained in detail in chapter 4 in the new extension guidelines for version 2023.4 and later.
- If you are running standard Analytics or have added the columns and tables for additional extensions you can continue and run the second script: Step2_Analytics_BC23_upgrade data.ps1
- Check that data has been moved to the new tables.
- In Powershell ISE run the DropTables.sql that was created in the BC23 Migration folder to drop the old prestaging tables.
- Start the replication again.
- From Analytics Azure Data factory, run Factory reset pipeline to reset the data warehouse and make sure that the staging tables include all columns.
Post update
Whether you moved the data to the new table structure or not, you must finalize the update by starting the Scheduled run trigger again, and verify that it is still set to the time and timezone you want.
Note: Remember to publish after you have reactivated the trigger and deleted the folder.