PixelCore Database Upgrade Process¶
When to use this process: * You need to upgrade a PixelCore deployment with changes affecting the database structure. * You need to restore a deployment using a backup.
Go through the following six steps in order.
Step 1 - Gather custom configurations¶
The configurations of the applications (any object in the applications tabs of Pixel Admin) are reset to their default values during the upgrade process.
Similarly those configurations are not saved during a database backup.
That means any non-default configuration must be saved separately when you do a backup or upgrade a deployment with a change in database structure.
In particular you must: * Save the LNS connection configurations (API url, owner, token). * Make a list of the custom workers that have been deployed and write down their configurations (active/inactive, source, any other setting specific to each worker).
If you are creating a backup make sure also to write the current version of the deployment.
After you make sure that you have all this information secured you can move on to the next step.
Step 2 - Do a database dump¶
Get the pix-dump-data.sh script from https://gl.thingularity.online/pixelcore/platform/-/tree/master/scripts%2Fdump-restore and use it to extract a database dump from the pix-core module.
For a cloud deployment:
./pix-dump-data.sh -k <k8s-pixelcore-pod-name> <namespace>
This script creates the two files that are needed to restore the database
Before moving on to the next step, make sure those files are not corrupted by attempting a restore on a clean test deployment (see step 5).
Step 3 - Remove the current deployment¶
Whether you are doing a restore from backup or a database upgrade you will need to do so on a clean deployment.
If you are running a local deployment that means stopping and cleaning the current deployment.
If you are running a cloud deployment and want to reuse the same namespace that means deleting and recreating the deployment in the namespace from scratch.
Be careful to do so only after check that step 1 and 2 have been complete and tested.
Step 4 - Create a new deployment¶
Create a clean deployment using: * The target version of the upgrade or the same version as the backup. * The same environment parameters as the original deployment (.env file).
Wait for the deployment to be ready before moving on to the next step.
Step 5 - Restore the database¶
Get the pix-restore-data.sh script from https://gl.thingularity.online/pixelcore/platform/-/tree/master/scripts%2Fdump-restore and use it together with the files extracted in step 2 to run a database restoration.
For a cloud deployment:
./pix-restore-data.sh -k <k8s-pixelcore-pod-name> <namespace> <db-data.sql-namespace> <object_properties_history.csv-namespace>
If this script completes without error you are ready to go to the next step. Otherwise check the database dump files for signs of corruption.
Step 6 - Restore custom configurations¶
Using the information you gathered in step 1, manually restore the non-default configurations of the applications and re-deploy the custom workers.
Process complete.