Fork your Aiven for PostgreSQL® service
Fork your Aiven for PostgreSQL® service to create an independent copy for testing, debugging, or development without affecting the original service.
Fork an Aiven service to create a complete copy of it from its latest backup. Forked services are independent and don't share resources with or increase the load on the original service. Common use cases for forking include:
- Creating a snapshot to analyze an issue.
- Creating a development copy of your production environment.
- Testing upgrades before applying them to production services.
- Creating an instance in a different cloud provider, region, or with a different plan.
- Renaming a service.
During the forking process, the fork might initially have only one node while backups are being taken. The other nodes appear after the backup process is complete.
When you fork a service, its configuration, databases, service users, and connection pools are copied to the new service.
Limitations
- You can only fork services that have at least one backup.
- Service integrations are not copied to the fork.
- Cross-project forking is supported only within the same organization.
Fork a service
- Console
- CLI
- API
- Terraform
- In your service, click Backups in the sidebar.
- Click Fork & restore.
- Choose the backup to fork from.
- Enter a name, and select the cloud and plan.
- Click Create fork.
Use the create service command with:
--service-to-fork-from: the name of the service to use as the source.--project-to-fork-from: to fork a service in a different project, set this to the project name the source service is in.
Use the
ServiceCreate endpoint
and in the user_config property set:
service_to_fork_from: the name of the source service.project_to_fork_from: to fork a service in a different project, set this to the name of the project the source service is in.
Use the service_to_fork_from attribute in the user config of your service resource.
To fork a service in a different project, set the project_to_fork_from attribute.
More information on the service resources and their configuration options is available in the Terraform documentation.
Fork from a specific point in time
- Console
- CLI
- API
- Terraform
- In your service, click Backups in the sidebar.
- Click Fork & restore.
- Choose the point in time to fork from.
- Enter a name, and choose the cloud and plan.
- Click Create fork.
Add the --recovery-target-time parameter to the
create service command
and set it to a time between the first and latest available backups.
Set the recovery_target_time parameter in the user_config property of the
ServiceCreate endpoint
to a time between the first and latest available backups.
Set the recovery_target_time attribute in the user config of your service
resource to a time between the first and latest available backups.
More information on the service resources and their configuration options is available in the Terraform documentation.
Related pages