Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,17 @@ public/
# content files
content/docs/postgresql/query-reference.md
content/docs/functions/json_extract_path.md
content/docs/introduction/monitoring-page.md
content/guides/honc.md

# auth docs (contain code samples with special annotations like // [!code ++])
content/docs/auth/quick-start/tanstack-router.md
content/docs/auth/quick-start/nextjs-api-only.md
content/docs/auth/quick-start/nextjs.md
content/docs/auth/quick-start/react.md
content/docs/auth/quick-start/react-router-components.md
content/docs/auth/guides/user-management.md
content/docs/auth/guides/configure-domains.md
content/docs/auth/guides/password-reset.md
content/docs/auth/guides/setup-oauth.md
content/docs/auth/guides/email-verification.md
2 changes: 1 addition & 1 deletion content/docs/community/contribution-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Documentation source files are located in the [neondatabase/website](https://git
1. Edit files directly on GitHub.
2. Fork the [neondatabase/website](https://github.com/neondatabase/website) repository, create a branch for your changes, and submit a pull request.

If you prefer the first option, which is great for edits and small updates, there is an **Edit this page** link at the bottom of each Neon documentation page.
If you prefer the first option, which is great for edits and small updates, there is an **Edit this page on GitHub** link in the right-hand sidebar of each Neon documentation page.

![GitHub edit this page link](/docs/community/edit_this_page.png)

Expand Down
77 changes: 52 additions & 25 deletions content/docs/introduction/branch-restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ Neon is open source and built in public, so if you are interested in understandi
Similar to the manual restore operation using the Neon Console and API described [here](/docs/guides/branching-pitr), the Restore operation performs a similar set of actions, but automatically:

1. On initiating a restore action, Neon builds a new point-in-time branch by matching your selected timestamp to the corresponding LSN of the relevant entries in the shared WAL record.
1. The compute for your initial branch is moved to this new branch so that your connection string remains stable.
1. We rename your new branch to the exact name as your initial branch, so the effect is seamless; it looks and acts like the same branch.
1. Your initial branch, which now has no compute attached to it, is renamed to _branch_name_old_head_timestamp_ to keep the pre-restore branch available should you need to roll back. Note: When restoring a root branch, both the new branch and the backup branch become root branches with no parent. When restoring a non-root branch, the initial branch (now the backup) becomes the parent of the new branch.
2. The compute for your initial branch is moved to this new branch so that your connection string remains stable.
3. We rename your new branch to the exact name as your initial branch, so the effect is seamless; it looks and acts like the same branch.
4. Your initial branch, which now has no compute attached to it, is renamed to _branch_name_old_head_timestamp_ to keep the pre-restore branch available should you need to roll back.

> When restoring a root branch, both the new branch and the backup branch become root branches with no parent. When restoring a non-root branch, the initial branch (now the backup) becomes the parent of the new branch.

</details>

Expand All @@ -108,34 +110,54 @@ You can use the Neon Console, CLI, or API to restore branches.

### Restoring from history

Use the **Restore** page to restore a branch to an earlier timestamp in its history.
Use the **Backup & Restore** page to restore a branch to an earlier point in time in its own or another branch's history.

First select the branch you want to restore from the left-hand branch list, then select the **Backup & Restore** tab.

![Branch Restore Page](/docs/guides/branch_restore_page.png)

#### Restore to the earlier state of the production branch

1. Make sure the **Enhanced view** toggle is enabled.
![Branch Restore from Production Branch](/docs/guides/branch_restore_from_production_branch.png)
2. Select the branch you want to restore in the sidebar.
3. Select the point in time you want to restore to using the timestamp selector. If you'd like to verify the data from that moment, click **Preview data**. This opens a *Preview historic data** window where you can browse, query, or compare the schema of your branch at the chosen timestamp.
4. Click **Restore to point in time** once you've selected the desired timestamp.

A confirmation window opens giving you details about the restore operation. Review these details to make sure you've made the correct selections.

First, select the **Branch to restore**. This is the target branch for the restore operation.
5. Click **Restore** to complete the operation.

![branch restore to timestamp](/docs/guides/branch_restore_timestamp.png)
This operation resets the current branch to the selected point in time in the production branch's history. All databases on the selected branch are instantly updated with the data and schema from the chosen point in time.

#### To restore a branch from its own history:
#### Restore to an earlier point in its own history

1. Make sure the **From history** tab is selected.
1. Choose your timestamp or switch to LSN.
1. Click **Next**.
1. Disable the **Enhanced view** toggle.
2. Make sure the **From history** tab is selected.
![Branch Restore from History](/docs/guides/branch_restore_from_history.png)
3. Choose your timestamp or switch to LSN.
4. Click **Schema Diff** to compare the current branch with the selected point in time. This opens a Schema Diff window showing a side-by-side visual comparison of the two schemas. Review the differences, close the window when you're finished, or repeat as needed until you identify the correct point in time.
5. Click **Proceed**.

A confirmation window opens giving you details about the pending restore operation. Review these details to make sure you've made the correct selections.
A confirmation window opens giving you details about the restore operation. Review these details to make sure you've made the correct selections.

1. Click **Restore** to complete the operation.
6. Click **Restore** to complete the operation.
This operation resets the current branch to the selected point in time in its own history. All databases on the selected branch are instantly updated with the data and schema from the chosen point in time.

#### To restore from another branch:
#### Restore to the earlier or latest state of another branch

1. Switch to the **From another branch** tab.
1. Select the source branch that you want to restore data from.
1. By default, the operation pulls the latest data from the source branch. If you want to pull from an earlier point in time, disable **Restore from latest data (head)**.
1. Disable the **Enhanced view** toggle.
2. Make sure the **From another branch** tab is selected.
3. In the **Restore from** dropdown, choose the source branch.
4. Select either **Timestamp** or **LSN** to define a point in time on the source branch. If you prefer to use the branch’s most recent data instead, you can enable **Restore from latest data (head)**.

The timestamp selector will appear.
5. Review the restore details and click **Proceed**.

1. Choose your timestamp or switch to the LSN input.
1. Click **Next**, confirm the details of the operation, then click **Restore** to complete.
A confirmation window opens giving you details about the restore operation. Review these details to make sure you've made the correct selections.

All databases on the selected branch are instantly updated with the data and schema from the chosen point in time. From the **Branches** page, you can now see a backup branch was created with the state of the branch at the restore point in time.
6. Click **Restore** to complete the operation.

All databases on the selected branch are instantly updated with the data and schema from the chosen point in time of the source branch.

<Admonition type="note">
Backup branches created when restoring a root branch from another branch cannot be deleted. See [Deleting backup branches](#deleting-backup-branches) for details.
Expand Down Expand Up @@ -227,14 +249,17 @@ curl --request POST \
In this example, we are restoring a development branch `dev/alex` (branch ID `br-twilight-river-31791249`) to the latest data (head) of its parent branch `br-jolly-star-07007859`. Note that we don't include any time identifier or backup branch name; this is a straight reset of the branch to the head of its parent.

```bash shouldWrap
curl --request POST \ // [!code word:br-twilight-river-31791249]
curl --request POST \
Copy link
Contributor Author

@dhanushreddy291 dhanushreddy291 Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current code highlight was broken, updated it

Before After
image

# [!code word:br-twilight-river-31791249]
--url https://console.neon.tech/api/v2/projects/floral-disk-86322740/branches/br-twilight-river-31791249/restore \
--header 'Accept: application/json' \
--header "Authorization: Bearer $NEON_API_KEY" \
--header 'Content-Type: application/json' \ // [!code word:br-jolly-star-07007859]
--header 'Content-Type: application/json' \
--data '
{
"source_branch_id": "br-jolly-star-07007859"}
# [!code word:br-jolly-star-07007859]
"source_branch_id": "br-jolly-star-07007859"
}
' | jq
```

Expand All @@ -243,13 +268,15 @@ curl --request POST \ // [!code word:br-twilight-river-31791249]
In this example, we are restoring branch `dev/jordan` (branch ID `br-damp-smoke-91135977`) to branch `dev/alex` (branch ID `br-twilight-river-31791249`) at the point in time of `Feb 26, 2024 12:00:00.000 AM`.

```bash shouldWrap
curl --request POST \ // [!code word:br-damp-smoke-91135977]
curl --request POST \
# [!code word:br-damp-smoke-91135977]
--url https://console.neon.tech/api/v2/projects/floral-disk-86322740/branches/br-damp-smoke-91135977/restore \
--header 'Accept: application/json' \
--header "Authorization: Bearer $NEON_API_KEY" \ // [!code word:br-jolly-star-07007859]
--header "Authorization: Bearer $NEON_API_KEY" \
--header 'Content-Type: application/json' \
--data '
{
# [!code word:br-jolly-star-07007859]
"source_branch_id": "br-jolly-star-07007859",
"source_timestamp": "2024-02-26T12:00:00Z"
}
Expand Down
4 changes: 0 additions & 4 deletions content/docs/introduction/regions.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ Neon offers project deployment in multiple AWS and Azure regions. To minimize la
- 🇺🇸 Azure West US 3 region (Arizona) &mdash; `azure-westus3`
- 🇩🇪 Azure Germany West Central region (Frankfurt) &mdash; `azure-gwc`

<Admonition type="note" title="Deployment options on azure">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Felt it unnecessary as native integration is being removed (the page it links https://neon.com/docs/manage/azure) is about native integration)

For information about Neon deployment options on Azure, see [Neon on Azure](/docs/manage/azure).
</Admonition>

## Request a region

<RequestForm type="region" />
Expand Down
7 changes: 3 additions & 4 deletions content/docs/manage/branches.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ To create a branch:
3. Click **New branch** to open the branch creation dialog.
4. Specify a branch name.
5. Select a **branch setup** option. If you're interested in schema-only branches, see [Schema-only branches](/docs/guides/branching-schema-only).

<Admonition type="note">
When creating a branch with past data, you can only specify a date and time that falls within your [restore window](/docs/introduction/restore-window).
</Admonition>
<Admonition type="note">
When creating a branch with past data, you can only specify a date and time that falls within your [restore window](/docs/introduction/restore-window).
</Admonition>

6. By default, **Automatically delete branch after** is checked with 1 day selected to help prevent unused branches from accumulating. You can choose 1 hour, 1 day, or 7 days, or uncheck to disable. This is useful for CI/CD pipelines and short-lived development environments. Note: This default only applies when creating branches through the Console; API and CLI branches have no expiration by default. Refer to our [Branch expiration guide](/docs/guides/branch-expiration) for details.
7. Click **Create new branch**.
Expand Down
3 changes: 1 addition & 2 deletions content/docs/manage/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ You can view system operations via the Neon Console, [Neon CLI](/docs/reference/

<TabItem>

You can view system operations via the **Monitoring** page in the Neon Console.
To view system operations for a specific branch, open the **Monitoring** page in the Neon Console. Select the desired branch from the left-hand sidebar, and the console will display the corresponding system operations.

![System operations](/docs/changelog/operations_monitoring.png)

Operation details include:

- **Operation**: The action performed by the operation.
- **Branch**: The branch on which the operation was performed.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Branch details aren't shown anymore as it needs to be selected from the sidebar

- **Compute**: The compute on which the operation occurred.
- **Operation status**: The status of the operation.
- **Duration**: The duration of the operation.
Expand Down
2 changes: 1 addition & 1 deletion content/guides/electric-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ElectricSQL requires a Postgres database with logical replication enabled. You'l
Make sure to turn off connection pooling in the connection string modal. This is essential for Electric to maintain a persistent connection to the Neon database.
</Admonition>

![Neon direct connection string modal](/docs/guides/neon-console-direct-connection-string.png)
![Neon direct connection string modal](/docs/connect/connection_details_without_connection_pooling.png)

## Setting up Electric

Expand Down
48 changes: 16 additions & 32 deletions content/guides/honc.md
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added file to .prettierignore to fix formatting issues

Before After
image

Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ The `create-honc-app` template comes with an example schema (for `users`) in `sr
import { pgTable, serial, text, boolean, timestamp } from 'drizzle-orm/pg-core';

export type NewUser = typeof users.$inferInsert; // [!code --]
export const users = pgTable('users', {
// [!code --]
export const users = pgTable('users', { // [!code --]
id: uuid('id').defaultRandom().primaryKey(), // [!code --]
name: text('name').notNull(), // [!code --]
email: text('email').notNull(), // [!code --]
Expand All @@ -182,8 +181,7 @@ The `create-honc-app` template comes with an example schema (for `users`) in `sr
updatedAt: timestamp('updated_at').defaultNow().notNull(), // [!code --]
}); // [!code --]

export const tasks = pgTable('tasks', {
// [!code ++]
export const tasks = pgTable('tasks', { // [!code ++]
id: serial('id').primaryKey(), // [!code ++]
title: text('title').notNull(), // [!code ++]
description: text('description'), // [!code ++]
Expand Down Expand Up @@ -236,68 +234,54 @@ The `src/index.ts` file generated by `create-honc-app` will contain Hono routes
// ... import statements and middleware for database connection

const UserSchema = z // [!code --]
.object({
// [!code --]
id: z.number().openapi({
// [!code --]
.object({ // [!code --]
id: z.number().openapi({ // [!code --]
example: 1, // [!code --]
}), // [!code --]
name: z.string().openapi({
// [!code --]
name: z.string().openapi({ // [!code --]
example: 'Nikita', // [!code --]
}), // [!code --]
email: z.string().email().openapi({
// [!code --]
email: z.string().email().openapi({ // [!code --]
example: 'nikita@neon.tech', // [!code --]
}), // [!code --]
}) // [!code --]
.openapi({ ref: 'User' }); // [!code --]

const TaskSchema = z // [!code ++]
.object({
// [!code ++]
id: z.string().openapi({
// [!code ++]
.object({ // [!code ++]
id: z.string().openapi({ // [!code ++]
description: 'The unique identifier for the task.', // [!code ++]
example: '1', // [!code ++]
}), // [!code ++]
title: z.string().openapi({
// [!code ++]
title: z.string().openapi({ // [!code ++]
description: 'The title of the task.', // [!code ++]
example: 'Learn HONC', // [!code ++]
}), // [!code ++]
description: z.string().nullable().optional().openapi({
// [!code ++]
description: z.string().nullable().optional().openapi({ // [!code ++]
description: 'A detailed description of the task.', // [!code ++]
example: 'Build a complete task API with the HONC Stack', // [!code ++]
}), // [!code ++]
completed: z.boolean().openapi({
// [!code ++]
completed: z.boolean().openapi({ // [!code ++]
description: 'Indicates if the task is completed.', // [!code ++]
example: false, // [!code ++]
}), // [!code ++]
createdAt: z.string().datetime().openapi({
// [!code ++]
createdAt: z.string().datetime().openapi({ // [!code ++]
description: 'The date and time when the task was created.', // [!code ++]
example: new Date().toISOString(), // [!code ++]
}), // [!code ++]
updatedAt: z.string().datetime().openapi({
// [!code ++]
updatedAt: z.string().datetime().openapi({ // [!code ++]
description: 'The date and time when the task was last updated.', // [!code ++]
example: new Date().toISOString(), // [!code ++]
}), // [!code ++]
}) // [!code ++]
.openapi({ ref: 'Task' }); // [!code ++]

const NewTaskSchema = z // [!code ++]
.object({
// [!code ++]
title: z.string().min(1, 'Title cannot be empty').openapi({
// [!code ++]
.object({ // [!code ++]
title: z.string().min(1, 'Title cannot be empty').openapi({ // [!code ++]
example: 'Deploy to Cloudflare', // [!code ++]
}), // [!code ++]
description: z.string().nullable().optional().openapi({
// [!code ++]
description: z.string().nullable().optional().openapi({ // [!code ++]
example: 'Finalize deployment steps for the task API.', // [!code ++]
}), // [!code ++]
}) // [!code ++]
Expand Down
2 changes: 1 addition & 1 deletion content/guides/self-hosting-umami-neon.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ To get started, go to the [Neon Console](https://console.neon.tech/app/projects)

You will be presented with a dialog that provides a connection string of your database. Enable the **Connection pooling** toggle for a pooled connection string.

![](/guides/images/self-hosting-umami-neon/1689d44f-4c5d-4b2a-8d13-32407f9c8781.png)
![Neon Connection string](/docs/connect/connection_details.png)

All Neon connection strings have the following format:

Expand Down
8 changes: 5 additions & 3 deletions content/guides/strapi-cms.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ To get started, go to the [Neon console](https://console.neon.tech/app/projects)

You will then be presented with a dialog that provides a connection string of your database. Enable the **Connection pooling** toggle for a pooled connection string.

![Neon Connection Details](/guides/images/strapi-cms/20b94d5f-aff4-4594-b60b-3a65d4fc884c.png)
![Neon Connection Details](/docs/connect/connection_details.png)

All Neon connection strings have the following format:

Expand Down Expand Up @@ -320,9 +320,11 @@ npm run build && npm run preview

## Scale-to-zero with Postgres (powered by Neon)

Interestingly, during the entire process of building this application, you have used Neon's **Scale-to-zero** feature which places your Postgres compute endpoint into an idle state after 5 minutes of inactivity. Click the **Operations** button in your Neon console sidebar to see when the compute was started and automatically suspended to reduce compute usage.
Interestingly, during the entire process of building this application, you have used Neon's **Scale-to-zero** feature which places your Postgres compute endpoint into an idle state after 5 minutes of inactivity.

![Neon Monitoring page](/guides/images/strapi-cms/ee753f7d-3da8-4a4c-84c5-be7b6cdce486.png)
Click on the **Monitoring** button in the Neon Console sidebar, then open **System operations** to see when the compute was started and automatically suspended to reduce usage.

![Neon Monitoring page](/docs/changelog/operations_monitoring.png)

## Summary

Expand Down
2 changes: 1 addition & 1 deletion content/guides/zero.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Zero requires a Postgres database (version 15+) with logical replication enabled
<Admonition type="important">
Make sure to turn off connection pooling in the connection string modal. This is essential for `zero-cache` to maintain a persistent connection to the Neon database.
</Admonition>
![Neon direct connection string modal](/docs/guides/neon-console-direct-connection-string.png)
![Neon direct connection string modal](/docs/connect/connection_details_without_connection_pooling.png)

## Setting up the `hello-zero` example application

Expand Down
Binary file modified public/docs/changelog/operations_monitoring.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/docs/community/edit_this_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/docs/connect/cold_start_compute_config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/docs/connect/compute_endpoint_state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/docs/extensions/edit_compute_endpoint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/docs/guides/branch_restore_backup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/docs/guides/branch_restore_backup_file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/docs/guides/branch_restore_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/docs/guides/branch_restore_timestamp.png
Binary file not shown.
Binary file not shown.
Binary file modified public/docs/import/dms_neon_table_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/docs/introduction/autoscaling_config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/docs/introduction/autosuspend_config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/docs/introduction/compute_state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/docs/oauth/consent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.