A step-by-step move from DigitalOcean App Platform to GCP: reading the app spec, mapping services, workers, jobs, Managed PostgreSQL, Valkey and Spaces to Cloud Run, Cloud SQL, Pub/Sub, Memorystore and Cloud Storage, moving the data with pg_dump and rclone, importing the database into an app that declares its infrastructure in code, and cutting over DNS.

App Platform is a good place to start a backend, and teams usually leave for GCP when a customer asks for it, when they want Pub/Sub or BigQuery next to the data, or when one app spec stops being enough. The move is mostly mapping components and moving two kinds of data.
This guide walks through the app spec, the data and the cutover.
Everything App Platform runs is described in the app spec, so export it with doctl apps spec get and list each component:
Look for services, workers, jobs (with kind: PRE_DEPLOY, POST_DEPLOY or a cron schedule), static_sites, databases, the environment variables marked as secrets, and the domains. Each one needs a destination before anything moves.
A worker that polls Valkey for jobs is the component most worth redesigning. On GCP, a Pub/Sub subscription that pushes messages with retries and a dead-letter topic replaces both the queue and the always-on poller.
DigitalOcean Managed PostgreSQL requires TLS and only accepts connections from trusted sources, so add the machine running the dump to the database's trusted sources first. For most databases, a dump and restore during a short write freeze is the simplest path:
pg_restore with --jobs restores tables in parallel, which shortens the freeze. Time a dry run against a copy before cutover day. For large databases or a downtime budget of minutes, Database Migration Service can replicate continuously from the source into Cloud SQL and promote at cutover, provided the source meets its requirements for extensions and replication.
Spaces speaks the S3 API, so rclone can copy a Space to a Cloud Storage bucket with an S3 remote for DigitalOcean and a Google Cloud Storage remote for the destination:
Run the sync once in bulk, then again right before cutover to pick up recent uploads. Public objects served from the Spaces CDN need new URLs, and presigned Spaces URLs stop working once readers switch.
Encore brings infrastructure from code, and the components from the app spec become declarations in the code that uses them. Encore provisions them in your own GCP project as Cloud Run, Cloud SQL, Pub/Sub and Cloud Storage, as the GCP infrastructure docs describe, and the worker and scheduled job become a subscription and a cron job.

Run in your terminal to get started locally.
One service that holds the API, the former worker and the former scheduled job, with the database, the uploads bucket and the queue declared next to them:
// app/app.ts
import { api, APIError } from "encore.dev/api";
import { getAuthData } from "~encore/auth";
import { SQLDatabase } from "encore.dev/storage/sqldb";
import { Bucket } from "encore.dev/storage/objects";
import { Topic, Subscription } from "encore.dev/pubsub";
import { CronJob } from "encore.dev/cron";
import log from "encore.dev/log";
// The name matches the database restored in step 3.
const db = new SQLDatabase("app", { migrations: "./migrations" });
const uploads = new Bucket("acme-uploads", { versioned: false });
interface OrderPlaced {
orderID: number;
}
const orderPlaced = new Topic<OrderPlaced>("order-placed", { deliveryGuarantee: "at-least-once" });
export const placeOrder = api(
{ expose: true, method: "POST", path: "/orders" },
async (p: { customerID: number; totalCents: number }): Promise<{ orderID: number }> => {
if (p.totalCents <= 0) throw APIError.invalidArgument("total must be positive");
const row = await db.queryRow<{ id: number }>`
INSERT INTO orders (customer_id, total_cents) VALUES (${p.customerID}, ${p.totalCents})
RETURNING id
`;
await orderPlaced.publish({ orderID: row!.id });
return { orderID: row!.id };
},
);
// Order IDs are sequential, so the caller must be signed in and own the order.
export const invoiceURL = api(
{ expose: true, auth: true, method: "GET", path: "/orders/:id/invoice" },
async ({ id }: { id: number }): Promise<{ url: string }> => {
const owned = await db.queryRow`
SELECT 1 FROM orders WHERE id = ${id} AND customer_id = ${Number(getAuthData()!.userID)}
`;
if (!owned) throw APIError.notFound("order not found");
const key = `invoices/${id}.pdf`;
if (!(await uploads.exists(key))) throw APIError.notFound("invoice not ready");
const { url } = await uploads.signedDownloadUrl(key, { ttl: 600 });
return { url };
},
);
// The former App Platform worker.
const _ = new Subscription(orderPlaced, "render-invoice", {
retryPolicy: { maxRetries: 5 },
handler: async ({ orderID }) => {
const order = await db.queryRow<{ total_cents: number }>`
SELECT total_cents FROM orders WHERE id = ${orderID}
`;
if (!order) return;
// Rendering the same key again on a retry overwrites the earlier attempt.
const body = Buffer.from(`Invoice ${orderID}: ${order.total_cents} cents\n`);
await uploads.upload(`invoices/${orderID}.pdf`, body, { contentType: "application/pdf" });
log.info("invoice rendered", { orderID });
},
});
// The former scheduled job.
export const purgeAbandoned = api({ expose: false }, async (): Promise<void> => {
await db.exec`DELETE FROM carts WHERE updated_at < now() - interval '30 days'`;
});
const _purge = new CronJob("purge-abandoned-carts", {
title: "Delete carts untouched for 30 days",
schedule: "0 2 * * *",
endpoint: purgeAbandoned,
});
The invoice body is a placeholder for your PDF renderer. The migration directory starts with a bootstrap migration made from the schema of the DigitalOcean database, so new environments get the same tables:
For production, the Cloud SQL import guide covers creating the environment with the Cloud SQL instance from step 3 instead of a new one. Encore tracks applied migrations in a schema_migrations table, so in the imported database mark the bootstrap as already applied, and only later migrations run against it:
CREATE TABLE IF NOT EXISTS schema_migrations (version bigint NOT NULL, dirty boolean NOT NULL);
INSERT INTO schema_migrations (version, dirty) VALUES (1, false);
encore run starts Postgres with the bootstrap schema, stores bucket objects on the local filesystem and runs the subscription, so an order can be placed and its invoice fetched on a laptop before the GCP environment exists. The purge is an Encore platform Managed cron job that runs in deployed environments, not locally or in preview environments, so call purgeAbandoned from the local dashboard to test it.
A coding agent porting the remaining App Platform components adds each one as a declaration in the same change as the code that uses it and runs it locally.
Best fit: Teams leaving App Platform for GCP that want the worker, schedules, database and bucket declared in the application instead of rebuilding them as separate Cloud Run jobs, schedules and IAM configuration.
rclone sync deletes objects that exist only in the destination.Cloud Run is the closest match, and App Platform services become Cloud Run services, workers become Cloud Run services that keep CPU allocated, and deploy-time and scheduled jobs become Cloud Run jobs. Managed PostgreSQL maps to Cloud SQL, Managed Valkey to Memorystore and Spaces to Cloud Storage.
For small and medium databases, take a pg_dump in custom format from DigitalOcean during a write freeze and restore it into Cloud SQL with pg_restore. For large databases or tight downtime windows, use Database Migration Service with continuous replication if your source meets its requirements.
Spaces is S3-compatible, so rclone can sync a Space to a Cloud Storage bucket with an S3 remote for Spaces and a Google Cloud Storage remote for the destination. Run it once in bulk and again right before cutover to pick up new objects.
Yes. With Encore, services, the database, Pub/Sub topics, buckets and cron jobs are declared in application code and provisioned in your own GCP project, and an existing Cloud SQL instance can be imported when the environment is created.
Deploy to your cloud on AWS and Google Cloud
without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.