-
Notifications
You must be signed in to change notification settings - Fork 293
docs: minor updates #4196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
docs: minor updates #4196
Changes from 9 commits
9f559db
6178b5c
382b38d
7af6428
210cc50
a1b22db
6415389
3f36dd0
56866e1
075d7a5
e2508ef
3366daa
730c85f
11c2438
f957405
6fa33b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,9 +86,9 @@ 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. 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. | ||
|
|
||
| </details> | ||
|
|
||
|
|
@@ -108,34 +108,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 to restore**. This is the target branch for the restore operation. | ||
| First select the branch you want to restore from the left-hand branch list, then select the **Backup & Restore** tab. | ||
|
|
||
|  | ||
|  | ||
|
|
||
| #### To restore a branch from its own history: | ||
| #### Restore to the earlier state of the production branch | ||
|
|
||
| 1. Make sure the **From history** tab is selected. | ||
| 1. Choose your timestamp or switch to LSN. | ||
| 1. Click **Next**. | ||
| 1. Make sure the **Enhanced view** toggle is enabled. | ||
|  | ||
| 2. The **Source branch** dropdown will automatically select the production branch of the current project. | ||
|
danieltprice marked this conversation as resolved.
Outdated
|
||
| 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 Data Preview window where you can view the state of your **Production** branch at the chosen timestamp. | ||
|
danieltprice marked this conversation as resolved.
Outdated
|
||
| 4. Click **Restore to point in time** once you've selected the desired timestamp. | ||
|
|
||
| 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. | ||
| 5. Click **Restore** to complete the operation. | ||
|
|
||
| #### To restore from another branch: | ||
| 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. | ||
|
|
||
| 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)**. | ||
| #### Restore to an earlier point in its own history | ||
|
|
||
| The timestamp selector will appear. | ||
| 1. Disable the **Enhanced view** toggle. | ||
| 2. Make sure the **From history** tab is selected. | ||
|  | ||
| 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**. | ||
|
|
||
| 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. | ||
| 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. | ||
|
|
||
| #### Restore to the earlier or latest state of another branch | ||
|
|
||
| 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)**. | ||
|
|
||
| 5. Review the restore details and click **Proceed**. | ||
|
|
||
| A confirmation window opens giving you details about the restore operation. Review these details to make sure you've made the correct selections. | ||
|
|
||
| 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. | ||
|
|
@@ -227,14 +247,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 \ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| # [!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 | ||
| ``` | ||
|
|
||
|
|
@@ -243,13 +266,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" | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,10 +26,6 @@ Neon offers project deployment in multiple AWS and Azure regions. To minimize la | |
| - 🇺🇸 Azure West US 3 region (Arizona) — `azure-westus3` | ||
| - 🇩🇪 Azure Germany West Central region (Frankfurt) — `azure-gwc` | ||
|
|
||
| <Admonition type="note" title="Deployment options on azure"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
|
|
||
|  | ||
|
|
||
| Operation details include: | ||
|
|
||
| - **Operation**: The action performed by the operation. | ||
| - **Branch**: The branch on which the operation was performed. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 --] | ||
|
|
@@ -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 ++] | ||
|
|
@@ -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: '[email protected]', // [!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 ++] | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.