Docs Home
Viewing docs for
Self-ManagedNot available for BYOC

Load a Savepoint from a Custom Location

On this page

Ververica Platform lets you start a deployment from a savepoint stored at any accessible storage location, not only savepoints managed within the platform. Use this when restoring state from an external source, such as a savepoint taken from a Ververica Platform 2 deployment.

Load Using the Kubernetes Operator

The Kubernetes Operator supports loading from a custom savepoint location through the spec.initialSavepointSpec.savepointLocation field. This requires two sequential kubectl apply operations.

Step 1: Register the Savepoint

Apply a CR that sets the deployment state to CANCELLED and includes initialSavepointSpec:

YAML
1apiVersion: ververica.platform/v1
2kind: VvpDeployment
3metadata:
4  name: my-deployment
5  namespace: vvp-system
6spec:
7  syncingMode: PATCH
8  initialSavepointSpec:
9    savepointLocation: s3://my-bucket/savepoints/savepoint-abc123
10  deployment:
11    userMetadata:
12      name: my-deployment
13      namespace: default
14      displayName: my-deployment
15    spec:
16      state: CANCELLED
17      deploymentTargetName: my-target
18      template:
19        spec:
20          artifact:
21            jarUri: file:///opt/flink/examples/streaming/MyJob.jar
22            kind: JAR

Wait until the savepoint appears in the deployment's state history with status COMPLETED.

Step 2: Start the Deployment

Apply a second CR with state: RUNNING. Omit initialSavepointSpec in this step:

YAML
1apiVersion: ververica.platform/v1
2kind: VvpDeployment
3metadata:
4  name: my-deployment
5  namespace: vvp-system
6spec:
7  syncingMode: PATCH
8  deployment:
9    userMetadata:
10      name: my-deployment
11      namespace: default
12      displayName: my-deployment
13    spec:
14      state: RUNNING
15      deploymentTargetName: my-target
16      template:
17        spec:
18          artifact:
19            jarUri: file:///opt/flink/examples/streaming/MyJob.jar
20            kind: JAR

The deployment starts and restores state from the savepoint.

Load Using the API

If you are not using the Kubernetes Operator, you can load a savepoint from a custom location by submitting a job through the REST API and setting restoreStrategy.kind to USER_DEFINED_STATE.

Prerequisites

  • You have a savepoint from your Ververica Platform 2 deployment and know its full storage path. For instructions on creating a savepoint, see Savepoints.
  • The savepoint path is accessible from the Ververica Platform 3 deployment (same storage backend and authentication).

Submit the Job

Send a POST request to the jobs start endpoint, passing the USER_DEFINED_STATE restore strategy with the savepoint path as statePath:

BASH
1curl -X POST 'https://app.ververica.cloud/api/v2/namespaces/{namespace}/jobs:start' \
2  -H 'authorization: Bearer {token}' \
3  -H 'accept: application/json' \
4  -H 'workspace: {workspace-id}' \
5  -H 'Content-Type: application/json' \
6  -d '{
7    "deploymentId": "{deployment-id}",
8    "restoreStrategy": {
9      "kind": "USER_DEFINED_STATE",
10      "statePath": "{savepoint-path}",
11      "allowNonRestoredState": false
12    },
13    "localVariables": []
14  }'

Replace {namespace}, {token}, {workspace-id}, {deployment-id}, and {savepoint-path} with your values.

Example: Migrate State from Ververica Platform 2 to Ververica Platform 3

  1. In Ververica Platform 2, trigger a savepoint on the running deployment and record the savepoint path (for example, s3://my-bucket/vvp2-jobs/namespaces/ns/jobs/abc123/savepoints/savepoint-xyz).
  2. In Ververica Platform 3, create a new deployment using an artifact that is compatible with the Ververica Platform 2 job's state schema.
  3. Load the Ververica Platform 2 savepoint path using either the Kubernetes Operator approach or the API approach described above.
  4. Start the deployment. It resumes from the state captured in Ververica Platform 2.

Troubleshooting

ProblemLikely causeResolution
Savepoint stays in PENDINGThe URI is unreachable or incorrectly formattedVerify the path and confirm the Ververica Platform pod has read access to the storage location.
Deployment fails on startThe savepoint is incompatible with the jobConfirm the artifact is state-compatible with the savepoint. Operator and schema changes between VVP versions can cause restore failures.
initialSavepointSpec has no effectThe deployment already existsThis field is applied only when the deployment is first created. Delete the deployment and apply the CR again.
Was this helpful?