Service forking
Fork your Aiven service to make a copy of the service, for example to create a snapshot to analyze an issue.
Other typical use cases include creating a development copy of your production environment, upgrade testing, or creating an instance in a different cloud/geographical location/under a different plan.
When you fork a service, the following items are copied into the new service:
- Configurations
- Databases
- Service users
- Connection pools
Forks are independent and do not increase the load on the original service. The data is restored from the latest backup stored separately from the service.
The service integrations are not copied over to the forked version, and need to be re-established for each new copy.
You can fork the following Aiven services:
-
PostgreSQL®
-
MySQL
-
Caching
-
Apache Cassandra® (Limitation: you cannot fork to a lower amount of nodes)
-
Elasticsearch
-
OpenSearch®
importantWhen you fork an Aiven for OpenSearch® service, any Single Sign-On (SSO) methods configured at the service level, such as SAML, must be explicitly reconfigured for the forked service. SSO configurations are linked to specific URLs and endpoints, which change during forking. Failing to reconfigure SSO methods for the forked service can lead to authentication problems and potentially disrupt user access.
-
M3DB
-
Grafana®
Fork a service
When forking a service with Point in Time Recovery (PITR), you can choose to fork from the latest transaction or select a specific point in the past to fork from. Fork your Aiven service to make a copy of the service.
You can only fork services that have at least one backup.
- Console
- CLI
- API
- Log in to Aiven Console.
- In your project, click Services and click the service to fork.
- Click Backups and click Fork & restore.
- In the New Database Fork window, set the details for the new service.
- Click Create fork.
Apply any integrations required by the fork.
-
Prepare the command to create service, this will contain the new copy of your data store.
-
Add the
service_to_fork_from
parameter to specify the service to use as the source. Change service type accordingly with-t
, run the following command to see available options:avn service types
For example, to create a fork of your forker
PostgreSQL®
service, and name it forked
, the command would be something like:
avn service create forked --project PROJECT_NAME --cloud CLOUD_NAME -t pg --plan business-4 -c service_to_fork_from=forker
Apply any integrations required by the fork.
Use the ServiceCreate
endpoint
and set the service_to_fork_from
and project_to_fork_from
parameters to specify the
source service in the user_config
property.
For example:
curl --location 'https://console.aiven.io/v1/project/dest-project/service' \
--header 'Content-Type: application/json' \
--header 'Authorization: token' \
--data '{
"cloud":"google-europe-central2",
"group_name":"default",
"plan":"business-4",
"service_name":"dest-name",
"service_type":"pg",
"user_config":{
"service_to_fork_from":"source-service",
"project_to_fork_from":"source-project",
"pg_version":"16"
}
}'
Apply any integrations required by the fork.
Rename a service
A service cannot be renamed after creation. Instead, use a fork:
- Stop service writes on the service to rename.
- Fork the service under a different name.
- Point clients to the new service.
- Delete the original service when you are ready.
Related pages
Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries.