Backup and restore
Keep a copy of the Platforma data that you can restore after a failure or a failed upgrade.
A backup of the database keeps all projects of users safe: after a failure or a failed upgrade, you restore it and continue where you stopped. The BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary makes these backups by itself, every day, so you always have earlier copies to go back to. Keep a copy outside the installation too, together with a copy of the secret and the settings that it needs.
What to keep
The database is the most important part: it holds all projects, and a project refers to its results in the primary storageprimary storage — The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files. Glossary. Without the database, the results stay in storage, but no project refers to them.
| Data | Where it is | How to keep it |
|---|---|---|
| Database: projects, BlocksBlock — A small application for one step of an analysis, for example the import of reads or clustering. It can combine several tools. Glossary, users, and the references to all results | KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary: a volume in the cluster. Single Server modeSingle Server mode — The mode in which the Backend and all its jobs run on one Linux machine, the server, with no Kubernetes cluster. Glossary: <main-root>/rocksdb |
The Backend makes a backup every day: see Automatic backups of the database. Before each upgrade, also make a backup now, and copy it out of the installation. |
| Results: the files that analyses make and that users upload | The primary storage: a bucket, or in Single Server mode the folder <main-root>/primary |
Turn on object versioning or soft delete on the bucket. In Single Server mode, copy the folder. |
| Master secret: encrypts the credentials that the database keeps | Kubernetes: the Secret platforma-master-secret. The installers also keep it in AWS Systems Manager Parameter Store or Google Secret Manager. Single Server mode: the master secret file, or the login token that the Backend makes the secret from |
Keep a copy outside the installation. |
| Settings | AWS installer: the stack parameters. Google Cloud installer: your answers and the release of platforma-helm. Terraform modulesTerraform modules — The Terraform code that MiLaboratories provides to install Platforma. The cloud-specific Terraform modules make the cluster and its cloud parts in AWS or Google Cloud; the cloud-agnostic Terraform modules install Platforma into the cluster. Glossary: your .tfvars files and the Terraform state. Helm chart: your values file. Single Server mode: the systemd unit and /etc/platforma |
Keep them in version control. |
| Workspaceworkspace — The storage where the Backend and all jobs keep the working files of running jobs. The Backend and the jobs use it at the same time. In Kubernetes, it is a network file system; in Single Server mode, it is a folder on the server. Glossary: the working files of jobsjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary that run now | Kubernetes: a file system that the Backend and all jobs share. Single Server mode: a folder on the server | No backup is necessary: jobs make it again. |
A database backup is useful only together with the primary storage and the master secret of the same installation.
The files that users import from a data librarydata library — A folder or bucket with input data of the company. Users select files from it in the Desktop App. Platforma only reads it. Glossary stay in the library: a project keeps only a link to them. To keep them with the results, copy them into the primary storage: see Copy the files of a library into the primary storage.
Make a backup now
The Backend makes its automatic backups on a schedule. Right before each upgrade, make one more backup now, so that it holds the last changes of users.
Tool: CloudFormation template
The commands use the namespace platforma and the release platforma. Change them if your
installation uses other names.
-
Write the database to a file on your computer. The BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary gives a copy of its database through its debug interface, which listens only inside the pod. The Backend continues to work during the copy.
Terminal window kubectl exec deployment/platforma -n platforma -c platforma -- \sh -c 'curl -fsS http://127.0.0.1:9091/db/state_raw | gzip' > backup-$(date +%F).tsv.gzWhen TLS is on in the chart (
network.tls.enabled: true), the debug interface accepts only HTTPS. Then usecurl -fsSk https://127.0.0.1:9091/db/state_rawin the command: the certificate names the domain of the installation, not127.0.0.1, and the connection does not go out of the pod.The time depends on the size of the database: from seconds to hours.
-
Check the file. The first test finds a file that stopped too early, for example when the connection to the cluster dropped. The second test finds an empty copy, for example when the debug interface refused the request. The third test finds the error message that the Backend writes as the last line when the copy fails.
Terminal window F=backup-$(date +%F).tsv.gzgzip -t "$F" && [ -n "$(gzip -dc "$F" | head -c 100)" ] \&& ! gzip -dc "$F" | tail -1 | grep -q 'Error happened' && echo OKResult:
OK. Keep the file in a place outside the installation, for example a bucket that Platforma does not use. -
Keep a copy of the master secret if you do not have one outside the cluster.
Terminal window kubectl get secret platforma-master-secret -n platforma \-o jsonpath='{.data.master-secret}' | base64 -d > master-secret.txtKeep the file as you keep a password, then delete the local copy.
Tool: install.sh in Cloud Shell
The commands use the namespace platforma and the release platforma. Change them if your
installation uses other names.
-
Write the database to a file on your computer. The BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary gives a copy of its database through its debug interface, which listens only inside the pod. The Backend continues to work during the copy.
Terminal window kubectl exec deployment/platforma -n platforma -c platforma -- \sh -c 'curl -fsS http://127.0.0.1:9091/db/state_raw | gzip' > backup-$(date +%F).tsv.gzWhen TLS is on in the chart (
network.tls.enabled: true), the debug interface accepts only HTTPS. Then usecurl -fsSk https://127.0.0.1:9091/db/state_rawin the command: the certificate names the domain of the installation, not127.0.0.1, and the connection does not go out of the pod.The time depends on the size of the database: from seconds to hours.
-
Check the file. The first test finds a file that stopped too early, for example when the connection to the cluster dropped. The second test finds an empty copy, for example when the debug interface refused the request. The third test finds the error message that the Backend writes as the last line when the copy fails.
Terminal window F=backup-$(date +%F).tsv.gzgzip -t "$F" && [ -n "$(gzip -dc "$F" | head -c 100)" ] \&& ! gzip -dc "$F" | tail -1 | grep -q 'Error happened' && echo OKResult:
OK. Keep the file in a place outside the installation, for example a bucket that Platforma does not use. -
Keep a copy of the master secret if you do not have one outside the cluster.
Terminal window kubectl get secret platforma-master-secret -n platforma \-o jsonpath='{.data.master-secret}' | base64 -d > master-secret.txtKeep the file as you keep a password, then delete the local copy.
Tool: platforma-tf-* modules (cloud and cloud-agnostic)
The commands use the namespace platforma and the release platforma. Change them if your
installation uses other names.
-
Write the database to a file on your computer. The BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary gives a copy of its database through its debug interface, which listens only inside the pod. The Backend continues to work during the copy.
Terminal window kubectl exec deployment/platforma -n platforma -c platforma -- \sh -c 'curl -fsS http://127.0.0.1:9091/db/state_raw | gzip' > backup-$(date +%F).tsv.gzWhen TLS is on in the chart (
network.tls.enabled: true), the debug interface accepts only HTTPS. Then usecurl -fsSk https://127.0.0.1:9091/db/state_rawin the command: the certificate names the domain of the installation, not127.0.0.1, and the connection does not go out of the pod.The time depends on the size of the database: from seconds to hours.
-
Check the file. The first test finds a file that stopped too early, for example when the connection to the cluster dropped. The second test finds an empty copy, for example when the debug interface refused the request. The third test finds the error message that the Backend writes as the last line when the copy fails.
Terminal window F=backup-$(date +%F).tsv.gzgzip -t "$F" && [ -n "$(gzip -dc "$F" | head -c 100)" ] \&& ! gzip -dc "$F" | tail -1 | grep -q 'Error happened' && echo OKResult:
OK. Keep the file in a place outside the installation, for example a bucket that Platforma does not use. -
Keep a copy of the master secret if you do not have one outside the cluster.
Terminal window kubectl get secret platforma-master-secret -n platforma \-o jsonpath='{.data.master-secret}' | base64 -d > master-secret.txtKeep the file as you keep a password, then delete the local copy.
Tool: platforma-backend
The commands use the namespace platforma and the release platforma. Change them if your
installation uses other names.
-
Write the database to a file on your computer. The BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary gives a copy of its database through its debug interface, which listens only inside the pod. The Backend continues to work during the copy.
Terminal window kubectl exec deployment/platforma -n platforma -c platforma -- \sh -c 'curl -fsS http://127.0.0.1:9091/db/state_raw | gzip' > backup-$(date +%F).tsv.gzWhen TLS is on in the chart (
network.tls.enabled: true), the debug interface accepts only HTTPS. Then usecurl -fsSk https://127.0.0.1:9091/db/state_rawin the command: the certificate names the domain of the installation, not127.0.0.1, and the connection does not go out of the pod.The time depends on the size of the database: from seconds to hours.
-
Check the file. The first test finds a file that stopped too early, for example when the connection to the cluster dropped. The second test finds an empty copy, for example when the debug interface refused the request. The third test finds the error message that the Backend writes as the last line when the copy fails.
Terminal window F=backup-$(date +%F).tsv.gzgzip -t "$F" && [ -n "$(gzip -dc "$F" | head -c 100)" ] \&& ! gzip -dc "$F" | tail -1 | grep -q 'Error happened' && echo OKResult:
OK. Keep the file in a place outside the installation, for example a bucket that Platforma does not use. -
Keep a copy of the master secret if you do not have one outside the cluster.
Terminal window kubectl get secret platforma-master-secret -n platforma \-o jsonpath='{.data.master-secret}' | base64 -d > master-secret.txtKeep the file as you keep a password, then delete the local copy.
Tool: platforma binary
In Single Server mode, copy the full data folder while the Backend is stopped.
-
Stop the Backend:
sudo systemctl stop platforma. -
Check that the Backend stopped.
Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary stopped:
Terminal window systemctl is-active platformapgrep -fa /opt/platforma/binaries/platformaResult: the first command prints
inactive, and the second command prints nothing. If a process is still there, wait and run the commands again. Do not continue while the process exists: it can still write to the database. -
Make the archive.
Terminal window sudo tar -czf platforma-backup-$(date +%F).tar.gz /data/platforma /etc/platforma -
Start the Backend:
sudo systemctl start platforma.
The archive holds the database, the results and the settings. Move it to a different machine.
Only the database, without a stop. The archive needs a stop of the Backend. To keep the last changes of users before an upgrade without a stop, write only the database to a file while the Backend runs:
-
Write the database to a file.
The BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary gives a copy of its database through its debug API. In Single Server modeSingle Server mode — The mode in which the Backend and all its jobs run on one Linux machine, the server, with no Kubernetes cluster. Glossary, the debug API is off by default. To turn it on, add a line to the environment file of the service and restart the Backend. You do this one time:
Terminal window echo 'PL_DEBUG_ENABLED=true' | sudo tee -a /etc/platforma/platforma.env > /dev/nullsudo systemctl restart platformaThe option
--debug-enabledin the start command does the same. The debug API then listens on127.0.0.1:9091(the options--debug-ipand--debug-port), so run the next command on the server. The Backend continues to work during the copy.Terminal window curl -fsS http://127.0.0.1:9091/db/state_raw | gzip > backup-$(date +%F).tsv.gzWhen the Backend uses TLS (
--listen-tlsor--self-signed-tls), the debug API accepts only HTTPS. Then usecurl -fsSk https://127.0.0.1:9091/db/state_rawin the command: the certificate names the domain of the server, not127.0.0.1, and the connection does not go out of the server. -
Check the file. The first test finds a file that stopped too early. The second test finds the error message that the Backend writes as the last line when the copy fails.
Terminal window F=backup-$(date +%F).tsv.gzgzip -t "$F" && ! gzip -dc "$F" | tail -1 | grep -q 'Error happened' && echo OKResult:
OK. Move the file to a different machine.
The file holds only the database. Keep the results and the settings as What to keep says. To restore the file, see Put back the database, “From a backup file”.
Disk snapshots
On Kubernetes, the database is on one cloud disk: the volume platforma-database. A snapshot of
this disk is a fast copy that the cloud keeps for you. Each new snapshot keeps only the data that
changed, so you can make one every day at a low cost, and a restore takes minutes. A snapshot works
only in the same cloud project or account. For a copy that you can restore anywhere, also make the
backup of Make a backup now.
A snapshot holds only the database. Protect the primary storage separately: the installers do not turn on object versioning on the bucket, so turn it on, or soft delete on Google Cloud Storage.
Tool: CloudFormation template
The database disk is a gp3 EBS volume (StorageClass gp3-retain, driver ebs.csi.aws.com). The installer
does not install the snapshot parts of Kubernetes. Before the first snapshot:
-
Add the Amazon EKS add-on
snapshot-controllerto the cluster. It also adds the Kubernetes objects for snapshots.Terminal window aws eks create-addon --cluster-name <cluster-name> --addon-name snapshot-controller -
Create a VolumeSnapshotClass:
apiVersion: snapshot.storage.k8s.io/v1kind: VolumeSnapshotClassmetadata:name: platforma-databasedriver: ebs.csi.aws.comdeletionPolicy: Retain
To make snapshots on a schedule without Kubernetes, use AWS Backup or Amazon Data Lifecycle Manager on the EBS volume. The cloud makes such a snapshot while the Backend runs. It is crash-consistent: the database is as after a sudden power failure, and the Backend usually starts on it. Use it as a second copy, not as your only backup. The ID of the volume is in its PersistentVolume:
kubectl get pv $(kubectl get pvc platforma-database -n platforma -o jsonpath='{.spec.volumeName}') \ -o jsonpath='{.spec.csi.volumeHandle}{"\n"}'deletionPolicy: Retain keeps the snapshot in the cloud when somebody deletes its KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary
object, for example with the namespace.
Make a snapshot. Stop the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary for the snapshot, so that the disk does not change during the copy.
-
Stop the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=0Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary pod is gone. The filter leaves out the pods of the cleanup jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary, which have the same release label:
Terminal window kubectl get pods -n platforma -l 'app.kubernetes.io/instance=platforma,!app.kubernetes.io/component'Result:
No resources found in platforma namespace.If the list shows a pod, also in the stateTerminating, wait and run the command again. Do not continue while the pod exists: it can still write to the database. -
Make the snapshot, and wait until it is ready:
Terminal window cat <<'EOF' | kubectl apply -f -apiVersion: snapshot.storage.k8s.io/v1kind: VolumeSnapshotmetadata:name: platforma-database-2026-11-24namespace: platformaspec:volumeSnapshotClassName: platforma-databasesource:persistentVolumeClaimName: platforma-databaseEOFkubectl wait volumesnapshot/platforma-database-2026-11-24 -n platforma \--for=jsonpath='{.status.readyToUse}'=true --timeout=60mUse the date in the name of each snapshot. The first snapshot copies the full disk and takes the longest.
-
Start the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=1
Restore from a snapshot. The restore makes a new database disk from the snapshot.
-
Stop the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=0Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary pod is gone. The filter leaves out the pods of the cleanup jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary, which have the same release label:
Terminal window kubectl get pods -n platforma -l 'app.kubernetes.io/instance=platforma,!app.kubernetes.io/component'Result:
No resources found in platforma namespace.If the list shows a pod, also in the stateTerminating, wait and run the command again. Do not continue while the pod exists: it can still write to the database. -
Check the snapshot. Do not continue unless the result is
true:Terminal window kubectl get volumesnapshot platforma-database-2026-11-24 -n platforma \-o jsonpath='{.status.readyToUse}{"\n"}' -
Keep the old disk, and write down its settings. The StorageClasses of the installers have
reclaimPolicy: Delete: without this step, the deletion of the volume claim deletes the disk.Terminal window PV=$(kubectl get pvc platforma-database -n platforma -o jsonpath='{.spec.volumeName}')kubectl patch pv "$PV" -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'kubectl get pvc platforma-database -n platforma \-o jsonpath='{.spec.storageClassName} {.spec.resources.requests.storage}{"\n"}'Result: the StorageClass and the size of the volume, for example
gp3 50Gi. -
Make a new database volume from the snapshot. Use the StorageClass and the size of step 3. The labels and annotations let Helm keep managing the new volume.
Terminal window kubectl delete pvc platforma-database -n platformacat <<'EOF' | kubectl apply -f -apiVersion: v1kind: PersistentVolumeClaimmetadata:name: platforma-databasenamespace: platformalabels:app.kubernetes.io/managed-by: Helmapp.kubernetes.io/component: databaseannotations:meta.helm.sh/release-name: platformameta.helm.sh/release-namespace: platformahelm.sh/resource-policy: keepspec:accessModes: [ReadWriteOnce]storageClassName: <storage-class>resources:requests:storage: <size>dataSource:apiGroup: snapshot.storage.k8s.iokind: VolumeSnapshotname: platforma-database-2026-11-24EOF -
Start the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=1Result: the Backend pod is
RunningandReady. In the Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary, an existing project opens with its results. Then delete the old disk:kubectl delete pv "$PV", and delete the disk in the console of the cloud account of your company.
Tool: install.sh in Cloud Shell
The database disk is an SSD Persistent Disk (StorageClass platforma-database-retain, driver
pd.csi.storage.gke.io). The installer turns on the Persistent Disk CSI driver, and GKE has the
snapshot parts of Kubernetes. Before the first snapshot, only create a VolumeSnapshotClass:
apiVersion: snapshot.storage.k8s.io/v1kind: VolumeSnapshotClassmetadata: name: platforma-databasedriver: pd.csi.storage.gke.iodeletionPolicy: RetainTo make snapshots on a schedule without Kubernetes, attach a snapshot schedule to the disk in Compute Engine. The cloud makes such a snapshot while the Backend runs. It is crash-consistent: the database is as after a sudden power failure, and the Backend usually starts on it. Use it as a second copy, not as your only backup. The name of the disk is in its PersistentVolume:
kubectl get pv $(kubectl get pvc platforma-database -n platforma -o jsonpath='{.spec.volumeName}') \ -o jsonpath='{.spec.csi.volumeHandle}{"\n"}'deletionPolicy: Retain keeps the snapshot in the cloud when somebody deletes its KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary
object, for example with the namespace.
Make a snapshot. Stop the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary for the snapshot, so that the disk does not change during the copy.
-
Stop the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=0Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary pod is gone. The filter leaves out the pods of the cleanup jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary, which have the same release label:
Terminal window kubectl get pods -n platforma -l 'app.kubernetes.io/instance=platforma,!app.kubernetes.io/component'Result:
No resources found in platforma namespace.If the list shows a pod, also in the stateTerminating, wait and run the command again. Do not continue while the pod exists: it can still write to the database. -
Make the snapshot, and wait until it is ready:
Terminal window cat <<'EOF' | kubectl apply -f -apiVersion: snapshot.storage.k8s.io/v1kind: VolumeSnapshotmetadata:name: platforma-database-2026-11-24namespace: platformaspec:volumeSnapshotClassName: platforma-databasesource:persistentVolumeClaimName: platforma-databaseEOFkubectl wait volumesnapshot/platforma-database-2026-11-24 -n platforma \--for=jsonpath='{.status.readyToUse}'=true --timeout=60mUse the date in the name of each snapshot. The first snapshot copies the full disk and takes the longest.
-
Start the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=1
Restore from a snapshot. The restore makes a new database disk from the snapshot.
-
Stop the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=0Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary pod is gone. The filter leaves out the pods of the cleanup jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary, which have the same release label:
Terminal window kubectl get pods -n platforma -l 'app.kubernetes.io/instance=platforma,!app.kubernetes.io/component'Result:
No resources found in platforma namespace.If the list shows a pod, also in the stateTerminating, wait and run the command again. Do not continue while the pod exists: it can still write to the database. -
Check the snapshot. Do not continue unless the result is
true:Terminal window kubectl get volumesnapshot platforma-database-2026-11-24 -n platforma \-o jsonpath='{.status.readyToUse}{"\n"}' -
Keep the old disk, and write down its settings. The StorageClasses of the installers have
reclaimPolicy: Delete: without this step, the deletion of the volume claim deletes the disk.Terminal window PV=$(kubectl get pvc platforma-database -n platforma -o jsonpath='{.spec.volumeName}')kubectl patch pv "$PV" -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'kubectl get pvc platforma-database -n platforma \-o jsonpath='{.spec.storageClassName} {.spec.resources.requests.storage}{"\n"}'Result: the StorageClass and the size of the volume, for example
gp3 50Gi. -
Make a new database volume from the snapshot. Use the StorageClass and the size of step 3. The labels and annotations let Helm keep managing the new volume.
Terminal window kubectl delete pvc platforma-database -n platformacat <<'EOF' | kubectl apply -f -apiVersion: v1kind: PersistentVolumeClaimmetadata:name: platforma-databasenamespace: platformalabels:app.kubernetes.io/managed-by: Helmapp.kubernetes.io/component: databaseannotations:meta.helm.sh/release-name: platformameta.helm.sh/release-namespace: platformahelm.sh/resource-policy: keepspec:accessModes: [ReadWriteOnce]storageClassName: <storage-class>resources:requests:storage: <size>dataSource:apiGroup: snapshot.storage.k8s.iokind: VolumeSnapshotname: platforma-database-2026-11-24EOF -
Start the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=1Result: the Backend pod is
RunningandReady. In the Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary, an existing project opens with its results. Then delete the old disk:kubectl delete pv "$PV", and delete the disk in the console of the cloud account of your company.
Tool: platforma-tf-* modules (cloud and cloud-agnostic)
With the cloud-specific Terraform modulescloud-specific Terraform modules — The Terraform modules platforma-tf-cloud-base and platforma-tf-cloud-cluster. There is one pair for each cloud, AWS and Google Cloud. The roots cloud and cluster apply them. They make the network, the Kubernetes cluster, the storage, the cloud identities and the registry caches. They give the hand-off file cluster_config to the cloud-agnostic Terraform modules. Glossary, the database disk has the StorageClass platforma-database that
platforma-tf-cloud-cluster makes: an EBS volume on AWS (driver ebs.csi.aws.com), a Persistent
Disk on Google Cloud (driver pd.csi.storage.gke.io). The modules do not install the snapshot parts
of Kubernetes. Before the first snapshot:
-
On AWS only, add the Amazon EKS add-on
snapshot-controllerto the cluster. GKE has these parts.Terminal window aws eks create-addon --cluster-name <cluster-name> --addon-name snapshot-controller -
Create a VolumeSnapshotClass for the driver of the disk:
apiVersion: snapshot.storage.k8s.io/v1kind: VolumeSnapshotClassmetadata:name: platforma-databasedriver: ebs.csi.aws.com # Google Cloud: pd.csi.storage.gke.iodeletionPolicy: Retain
On an own cluster, do as in the tab “Helm chart”.
deletionPolicy: Retain keeps the snapshot in the cloud when somebody deletes its KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary
object, for example with the namespace.
Make a snapshot. Stop the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary for the snapshot, so that the disk does not change during the copy.
-
Stop the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=0Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary pod is gone. The filter leaves out the pods of the cleanup jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary, which have the same release label:
Terminal window kubectl get pods -n platforma -l 'app.kubernetes.io/instance=platforma,!app.kubernetes.io/component'Result:
No resources found in platforma namespace.If the list shows a pod, also in the stateTerminating, wait and run the command again. Do not continue while the pod exists: it can still write to the database. -
Make the snapshot, and wait until it is ready:
Terminal window cat <<'EOF' | kubectl apply -f -apiVersion: snapshot.storage.k8s.io/v1kind: VolumeSnapshotmetadata:name: platforma-database-2026-11-24namespace: platformaspec:volumeSnapshotClassName: platforma-databasesource:persistentVolumeClaimName: platforma-databaseEOFkubectl wait volumesnapshot/platforma-database-2026-11-24 -n platforma \--for=jsonpath='{.status.readyToUse}'=true --timeout=60mUse the date in the name of each snapshot. The first snapshot copies the full disk and takes the longest.
-
Start the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=1
Restore from a snapshot. The restore makes a new database disk from the snapshot.
-
Stop the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=0Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary pod is gone. The filter leaves out the pods of the cleanup jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary, which have the same release label:
Terminal window kubectl get pods -n platforma -l 'app.kubernetes.io/instance=platforma,!app.kubernetes.io/component'Result:
No resources found in platforma namespace.If the list shows a pod, also in the stateTerminating, wait and run the command again. Do not continue while the pod exists: it can still write to the database. -
Check the snapshot. Do not continue unless the result is
true:Terminal window kubectl get volumesnapshot platforma-database-2026-11-24 -n platforma \-o jsonpath='{.status.readyToUse}{"\n"}' -
Keep the old disk, and write down its settings. The StorageClasses of the installers have
reclaimPolicy: Delete: without this step, the deletion of the volume claim deletes the disk.Terminal window PV=$(kubectl get pvc platforma-database -n platforma -o jsonpath='{.spec.volumeName}')kubectl patch pv "$PV" -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'kubectl get pvc platforma-database -n platforma \-o jsonpath='{.spec.storageClassName} {.spec.resources.requests.storage}{"\n"}'Result: the StorageClass and the size of the volume, for example
gp3 50Gi. -
Make a new database volume from the snapshot. Use the StorageClass and the size of step 3. The labels and annotations let Helm keep managing the new volume.
Terminal window kubectl delete pvc platforma-database -n platformacat <<'EOF' | kubectl apply -f -apiVersion: v1kind: PersistentVolumeClaimmetadata:name: platforma-databasenamespace: platformalabels:app.kubernetes.io/managed-by: Helmapp.kubernetes.io/component: databaseannotations:meta.helm.sh/release-name: platformameta.helm.sh/release-namespace: platformahelm.sh/resource-policy: keepspec:accessModes: [ReadWriteOnce]storageClassName: <storage-class>resources:requests:storage: <size>dataSource:apiGroup: snapshot.storage.k8s.iokind: VolumeSnapshotname: platforma-database-2026-11-24EOF -
Start the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=1Result: the Backend pod is
RunningandReady. In the Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary, an existing project opens with its results. Then delete the old disk:kubectl delete pv "$PV", and delete the disk in the console of the cloud account of your company.
Tool: platforma-backend
Snapshots depend on the cluster. Before the first snapshot:
-
Make sure that the cluster has a CSI driver for the database disk that can make snapshots, and the Kubernetes snapshot controller. Ask the team that runs the cluster.
-
Create a VolumeSnapshotClass with the name
platforma-databasefor the driver of your StorageClass:apiVersion: snapshot.storage.k8s.io/v1kind: VolumeSnapshotClassmetadata:name: platforma-databasedriver: <the driver of your StorageClass>deletionPolicy: Retain
deletionPolicy: Retain keeps the snapshot in the cloud when somebody deletes its KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary
object, for example with the namespace.
Make a snapshot. Stop the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary for the snapshot, so that the disk does not change during the copy.
-
Stop the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=0Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary pod is gone. The filter leaves out the pods of the cleanup jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary, which have the same release label:
Terminal window kubectl get pods -n platforma -l 'app.kubernetes.io/instance=platforma,!app.kubernetes.io/component'Result:
No resources found in platforma namespace.If the list shows a pod, also in the stateTerminating, wait and run the command again. Do not continue while the pod exists: it can still write to the database. -
Make the snapshot, and wait until it is ready:
Terminal window cat <<'EOF' | kubectl apply -f -apiVersion: snapshot.storage.k8s.io/v1kind: VolumeSnapshotmetadata:name: platforma-database-2026-11-24namespace: platformaspec:volumeSnapshotClassName: platforma-databasesource:persistentVolumeClaimName: platforma-databaseEOFkubectl wait volumesnapshot/platforma-database-2026-11-24 -n platforma \--for=jsonpath='{.status.readyToUse}'=true --timeout=60mUse the date in the name of each snapshot. The first snapshot copies the full disk and takes the longest.
-
Start the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=1
Restore from a snapshot. The restore makes a new database disk from the snapshot.
-
Stop the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=0Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary pod is gone. The filter leaves out the pods of the cleanup jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary, which have the same release label:
Terminal window kubectl get pods -n platforma -l 'app.kubernetes.io/instance=platforma,!app.kubernetes.io/component'Result:
No resources found in platforma namespace.If the list shows a pod, also in the stateTerminating, wait and run the command again. Do not continue while the pod exists: it can still write to the database. -
Check the snapshot. Do not continue unless the result is
true:Terminal window kubectl get volumesnapshot platforma-database-2026-11-24 -n platforma \-o jsonpath='{.status.readyToUse}{"\n"}' -
Keep the old disk, and write down its settings. The StorageClasses of the installers have
reclaimPolicy: Delete: without this step, the deletion of the volume claim deletes the disk.Terminal window PV=$(kubectl get pvc platforma-database -n platforma -o jsonpath='{.spec.volumeName}')kubectl patch pv "$PV" -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'kubectl get pvc platforma-database -n platforma \-o jsonpath='{.spec.storageClassName} {.spec.resources.requests.storage}{"\n"}'Result: the StorageClass and the size of the volume, for example
gp3 50Gi. -
Make a new database volume from the snapshot. Use the StorageClass and the size of step 3. The labels and annotations let Helm keep managing the new volume.
Terminal window kubectl delete pvc platforma-database -n platformacat <<'EOF' | kubectl apply -f -apiVersion: v1kind: PersistentVolumeClaimmetadata:name: platforma-databasenamespace: platformalabels:app.kubernetes.io/managed-by: Helmapp.kubernetes.io/component: databaseannotations:meta.helm.sh/release-name: platformameta.helm.sh/release-namespace: platformahelm.sh/resource-policy: keepspec:accessModes: [ReadWriteOnce]storageClassName: <storage-class>resources:requests:storage: <size>dataSource:apiGroup: snapshot.storage.k8s.iokind: VolumeSnapshotname: platforma-database-2026-11-24EOF -
Start the Backend.
Terminal window kubectl scale deployment platforma -n platforma --replicas=1Result: the Backend pod is
RunningandReady. In the Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary, an existing project opens with its results. Then delete the old disk:kubectl delete pv "$PV", and delete the disk in the console of the cloud account of your company.
Tool: platforma binary
Use the snapshots of the server’s disk, if your platform has them. Stop the Backend before the snapshot, and check that it stopped, as in Make a backup now.
Restore
A restore replaces the database with the backup. All changes that users made after the backup are lost. Results made after the backup stay in the storage, but no project refers to them.
Automatic backups of the database
After an outage, a damaged database or any other failure, you can always go back to an earlier copy of the database: the Backend keeps them in the primary storage.
- When: the Backend makes a backup when it starts, and then every 24 hours while it runs.
- Where: in the folder
db-backups/of the primary storage: the bucket and its prefix, or in Single Server mode the folder/data/platforma/primary/db-backups/. - Names: the date and time of the backup in UTC, for example
2026-11-27_031500.tsv.gz. The names sort from the oldest to the newest. - How many: the newest 14. After each new backup, the Backend deletes the older ones.
- Checks: before the upload, the Backend compares the backup with the database.
The same holds in Kubernetes and in Single Server mode. To change the interval, the number of kept backups, the folder, or to send the backups to a different bucket or folder, see Backups of the database. The automatic backups are as safe as the primary storage: protect it, as What to keep says, or send the backups to a different place.
Get the backup file
Choose the newest backup from before the failure. The commands use the bucket and the prefix of the primary storage; if the backups go to a different place, use that place.
List the backups, then copy the chosen file to your computer.
aws s3 ls s3://<bucket>/<prefix>db-backups/aws s3 cp s3://<bucket>/<prefix>db-backups/<name>.tsv.gz .gcloud storage ls gs://<bucket>/<prefix>db-backups/gcloud storage cp gs://<bucket>/<prefix>db-backups/<name>.tsv.gz .Result: the file is on your computer. It is the <backup-file> of the restore steps.
List the backups, then copy the chosen file to a folder that the user platforma can read:
ls /data/platforma/primary/db-backups/sudo cp /data/platforma/primary/db-backups/<name>.tsv.gz /tmp/If the primary storage is a bucket, copy the file from the bucket, as in the tab “Kubernetes cluster”.
Result: the file is in /tmp. It is the <backup-file> of the restore steps.
Put back the database
Tool: CloudFormation template
-
Stop the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary.
Terminal window kubectl scale deployment platforma -n platforma --replicas=0Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary pod is gone. The filter leaves out the pods of the cleanup jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary, which have the same release label:
Terminal window kubectl get pods -n platforma -l 'app.kubernetes.io/instance=platforma,!app.kubernetes.io/component'Result:
No resources found in platforma namespace.If the list shows a pod, also in the stateTerminating, wait and run the command again. Do not continue while the pod exists: it can still write to the database. -
Start a restore pod. The pod copies the settings of the Backend: the same nodes, resources and database volume. Set
IMAGEto the Backend image that must run after the restore. After a failed upgrade, this is the old image. The command makes the pod withjq: install it on your computer first.Terminal window IMAGE=<backend-image>kubectl get deployment platforma -n platforma -o json | jq --arg image "$IMAGE" '.spec.template.spec as $s| ($s.containers[] | select(.name == "platforma")) as $c| {apiVersion: "v1", kind: "Pod",metadata: {name: "platforma-restore", namespace: .metadata.namespace},spec: {restartPolicy: "Never",securityContext: $s.securityContext,nodeSelector: $s.nodeSelector,tolerations: $s.tolerations,affinity: $s.affinity,containers: [{name: "restore",image: $image,command: ["sleep", "infinity"],securityContext: $c.securityContext,resources: $c.resources,volumeMounts: [{name: "database", mountPath: "/data/database"}]}],volumes: [$s.volumes[] | select(.name == "database")]}}' | kubectl apply -f -kubectl wait pod/platforma-restore -n platforma --for=condition=Ready --timeout=600s -
Restore the backup. Copy the file into the pod, and empty the database folder: a newer version can write files that the restore of an older version cannot open. Then start the restore in the background, so that it continues if your connection stops:
Terminal window kubectl exec -i platforma-restore -n platforma -- \sh -c 'cat > /tmp/backup.tsv.gz' < <backup-file>kubectl exec platforma-restore -n platforma -- \find /data/database -mindepth 1 -maxdepth 1 ! -name lost+found -exec rm -rf {} +kubectl exec platforma-restore -n platforma -- sh -c \'nohup sh -c "/app/platforma --restore-db=/tmp/backup.tsv.gz --db-dir=/data/database --force && echo RESTORE OK || echo RESTORE FAILED" > /tmp/restore.log 2>&1 &'The restore takes from minutes to hours: this depends on the size of the database. To see the progress:
Terminal window kubectl exec platforma-restore -n platforma -- tail -5 /tmp/restore.logResult: the last line is
RESTORE OK. Then delete the pod:kubectl delete pod platforma-restore -n platforma. If the last line isRESTORE FAILED, keep the pod and send/tmp/restore.logto MiLaboratories support. -
Start the Backend. After a failed upgrade, deploy the old version: see Go back to the old version. In all other cases:
Terminal window kubectl scale deployment platforma -n platforma --replicas=1Result: the Backend pod is
RunningandReady. In the Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary, an existing project opens with its results.
Tool: install.sh in Cloud Shell
-
Stop the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary.
Terminal window kubectl scale deployment platforma -n platforma --replicas=0Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary pod is gone. The filter leaves out the pods of the cleanup jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary, which have the same release label:
Terminal window kubectl get pods -n platforma -l 'app.kubernetes.io/instance=platforma,!app.kubernetes.io/component'Result:
No resources found in platforma namespace.If the list shows a pod, also in the stateTerminating, wait and run the command again. Do not continue while the pod exists: it can still write to the database. -
Start a restore pod. The pod copies the settings of the Backend: the same nodes, resources and database volume. Set
IMAGEto the Backend image that must run after the restore. After a failed upgrade, this is the old image. The command makes the pod withjq: install it on your computer first.Terminal window IMAGE=<backend-image>kubectl get deployment platforma -n platforma -o json | jq --arg image "$IMAGE" '.spec.template.spec as $s| ($s.containers[] | select(.name == "platforma")) as $c| {apiVersion: "v1", kind: "Pod",metadata: {name: "platforma-restore", namespace: .metadata.namespace},spec: {restartPolicy: "Never",securityContext: $s.securityContext,nodeSelector: $s.nodeSelector,tolerations: $s.tolerations,affinity: $s.affinity,containers: [{name: "restore",image: $image,command: ["sleep", "infinity"],securityContext: $c.securityContext,resources: $c.resources,volumeMounts: [{name: "database", mountPath: "/data/database"}]}],volumes: [$s.volumes[] | select(.name == "database")]}}' | kubectl apply -f -kubectl wait pod/platforma-restore -n platforma --for=condition=Ready --timeout=600s -
Restore the backup. Copy the file into the pod, and empty the database folder: a newer version can write files that the restore of an older version cannot open. Then start the restore in the background, so that it continues if your connection stops:
Terminal window kubectl exec -i platforma-restore -n platforma -- \sh -c 'cat > /tmp/backup.tsv.gz' < <backup-file>kubectl exec platforma-restore -n platforma -- \find /data/database -mindepth 1 -maxdepth 1 ! -name lost+found -exec rm -rf {} +kubectl exec platforma-restore -n platforma -- sh -c \'nohup sh -c "/app/platforma --restore-db=/tmp/backup.tsv.gz --db-dir=/data/database --force && echo RESTORE OK || echo RESTORE FAILED" > /tmp/restore.log 2>&1 &'The restore takes from minutes to hours: this depends on the size of the database. To see the progress:
Terminal window kubectl exec platforma-restore -n platforma -- tail -5 /tmp/restore.logResult: the last line is
RESTORE OK. Then delete the pod:kubectl delete pod platforma-restore -n platforma. If the last line isRESTORE FAILED, keep the pod and send/tmp/restore.logto MiLaboratories support. -
Start the Backend. After a failed upgrade, deploy the old version: see Go back to the old version. In all other cases:
Terminal window kubectl scale deployment platforma -n platforma --replicas=1Result: the Backend pod is
RunningandReady. In the Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary, an existing project opens with its results.
Tool: platforma-tf-* modules (cloud and cloud-agnostic)
-
Stop the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary.
Terminal window kubectl scale deployment platforma -n platforma --replicas=0Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary pod is gone. The filter leaves out the pods of the cleanup jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary, which have the same release label:
Terminal window kubectl get pods -n platforma -l 'app.kubernetes.io/instance=platforma,!app.kubernetes.io/component'Result:
No resources found in platforma namespace.If the list shows a pod, also in the stateTerminating, wait and run the command again. Do not continue while the pod exists: it can still write to the database. -
Start a restore pod. The pod copies the settings of the Backend: the same nodes, resources and database volume. Set
IMAGEto the Backend image that must run after the restore. After a failed upgrade, this is the old image. The command makes the pod withjq: install it on your computer first.Terminal window IMAGE=<backend-image>kubectl get deployment platforma -n platforma -o json | jq --arg image "$IMAGE" '.spec.template.spec as $s| ($s.containers[] | select(.name == "platforma")) as $c| {apiVersion: "v1", kind: "Pod",metadata: {name: "platforma-restore", namespace: .metadata.namespace},spec: {restartPolicy: "Never",securityContext: $s.securityContext,nodeSelector: $s.nodeSelector,tolerations: $s.tolerations,affinity: $s.affinity,containers: [{name: "restore",image: $image,command: ["sleep", "infinity"],securityContext: $c.securityContext,resources: $c.resources,volumeMounts: [{name: "database", mountPath: "/data/database"}]}],volumes: [$s.volumes[] | select(.name == "database")]}}' | kubectl apply -f -kubectl wait pod/platforma-restore -n platforma --for=condition=Ready --timeout=600s -
Restore the backup. Copy the file into the pod, and empty the database folder: a newer version can write files that the restore of an older version cannot open. Then start the restore in the background, so that it continues if your connection stops:
Terminal window kubectl exec -i platforma-restore -n platforma -- \sh -c 'cat > /tmp/backup.tsv.gz' < <backup-file>kubectl exec platforma-restore -n platforma -- \find /data/database -mindepth 1 -maxdepth 1 ! -name lost+found -exec rm -rf {} +kubectl exec platforma-restore -n platforma -- sh -c \'nohup sh -c "/app/platforma --restore-db=/tmp/backup.tsv.gz --db-dir=/data/database --force && echo RESTORE OK || echo RESTORE FAILED" > /tmp/restore.log 2>&1 &'The restore takes from minutes to hours: this depends on the size of the database. To see the progress:
Terminal window kubectl exec platforma-restore -n platforma -- tail -5 /tmp/restore.logResult: the last line is
RESTORE OK. Then delete the pod:kubectl delete pod platforma-restore -n platforma. If the last line isRESTORE FAILED, keep the pod and send/tmp/restore.logto MiLaboratories support. -
Start the Backend. After a failed upgrade, deploy the old version: see Go back to the old version. In all other cases:
Terminal window kubectl scale deployment platforma -n platforma --replicas=1Result: the Backend pod is
RunningandReady. In the Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary, an existing project opens with its results.
Tool: platforma-backend
-
Stop the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary.
Terminal window kubectl scale deployment platforma -n platforma --replicas=0Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary pod is gone. The filter leaves out the pods of the cleanup jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary, which have the same release label:
Terminal window kubectl get pods -n platforma -l 'app.kubernetes.io/instance=platforma,!app.kubernetes.io/component'Result:
No resources found in platforma namespace.If the list shows a pod, also in the stateTerminating, wait and run the command again. Do not continue while the pod exists: it can still write to the database. -
Start a restore pod. The pod copies the settings of the Backend: the same nodes, resources and database volume. Set
IMAGEto the Backend image that must run after the restore. After a failed upgrade, this is the old image. The command makes the pod withjq: install it on your computer first.Terminal window IMAGE=<backend-image>kubectl get deployment platforma -n platforma -o json | jq --arg image "$IMAGE" '.spec.template.spec as $s| ($s.containers[] | select(.name == "platforma")) as $c| {apiVersion: "v1", kind: "Pod",metadata: {name: "platforma-restore", namespace: .metadata.namespace},spec: {restartPolicy: "Never",securityContext: $s.securityContext,nodeSelector: $s.nodeSelector,tolerations: $s.tolerations,affinity: $s.affinity,containers: [{name: "restore",image: $image,command: ["sleep", "infinity"],securityContext: $c.securityContext,resources: $c.resources,volumeMounts: [{name: "database", mountPath: "/data/database"}]}],volumes: [$s.volumes[] | select(.name == "database")]}}' | kubectl apply -f -kubectl wait pod/platforma-restore -n platforma --for=condition=Ready --timeout=600s -
Restore the backup. Copy the file into the pod, and empty the database folder: a newer version can write files that the restore of an older version cannot open. Then start the restore in the background, so that it continues if your connection stops:
Terminal window kubectl exec -i platforma-restore -n platforma -- \sh -c 'cat > /tmp/backup.tsv.gz' < <backup-file>kubectl exec platforma-restore -n platforma -- \find /data/database -mindepth 1 -maxdepth 1 ! -name lost+found -exec rm -rf {} +kubectl exec platforma-restore -n platforma -- sh -c \'nohup sh -c "/app/platforma --restore-db=/tmp/backup.tsv.gz --db-dir=/data/database --force && echo RESTORE OK || echo RESTORE FAILED" > /tmp/restore.log 2>&1 &'The restore takes from minutes to hours: this depends on the size of the database. To see the progress:
Terminal window kubectl exec platforma-restore -n platforma -- tail -5 /tmp/restore.logResult: the last line is
RESTORE OK. Then delete the pod:kubectl delete pod platforma-restore -n platforma. If the last line isRESTORE FAILED, keep the pod and send/tmp/restore.logto MiLaboratories support. -
Start the Backend. After a failed upgrade, deploy the old version: see Go back to the old version. In all other cases:
Terminal window kubectl scale deployment platforma -n platforma --replicas=1Result: the Backend pod is
RunningandReady. In the Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary, an existing project opens with its results.
Tool: platforma binary
From a backup file (an automatic backup):
-
Stop the Backend:
sudo systemctl stop platforma. -
Check that the Backend stopped.
Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary stopped:
Terminal window systemctl is-active platformapgrep -fa /opt/platforma/binaries/platformaResult: the first command prints
inactive, and the second command prints nothing. If a process is still there, wait and run the commands again. Do not continue while the process exists: it can still write to the database. -
Restore the backup. Move the database folder aside, and make the database again from the file:
Terminal window sudo mv /data/platforma/rocksdb /data/platforma/rocksdb.before-restoresudo -u platforma /opt/platforma/binaries/platforma \--restore-db=<backup-file> --db-dir=/data/platforma/rocksdb --forceThe restore takes from minutes to hours: this depends on the size of the database. Result: the output has the line
Database restored successfully. Delete/data/platforma/rocksdb.before-restorewhen the Backend works again. -
Start the Backend:
sudo systemctl start platforma.
From an archive of Make a backup now:
-
Stop the Backend:
sudo systemctl stop platforma. -
Check that the Backend stopped.
Check that the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary stopped:
Terminal window systemctl is-active platformapgrep -fa /opt/platforma/binaries/platformaResult: the first command prints
inactive, and the second command prints nothing. If a process is still there, wait and run the commands again. Do not continue while the process exists: it can still write to the database. -
Put back the data folder from the archive:
Terminal window sudo mv /data/platforma /data/platforma.before-restoresudo tar -xzf <archive> -C / data/platformaIf the archive does not have any results, also put back the primary storage. Files that the Backend wrote after the backup can stay: no project refers to them.
Terminal window sudo rsync -a <backup-place>/primary/ /data/platforma/primary/sudo chown -R platforma:platforma /data/platformaResult:
/data/platformahas the content of the archive. Delete/data/platforma.before-restorewhen the Backend works again. -
Start the Backend:
sudo systemctl start platforma.