Skip to content

Environments

Copy a project into an environment_

Learn what an Appwrite project environment copies from its project, from database schemas and buckets to functions, sites, and settings, and what always stays behind.

3 min read

Raw

When you create an environment as a Clone of the project, Appwrite copies the project into it once. Each part of the project copies its structure and settings by default. Parts that hold data, such as rows, files, and users, copy that data only when you tick it.

A copy is a one-time snapshot. Changes made to production afterwards don't reach the environment, and changes made in the environment never reach production.

What a copy includes

GroupStructure and settingsData, when you tick it
DatabasesDatabases, tables, columns, and indexesRows and documents
StorageBuckets and their settingsFiles
AuthTeams, auth methods, security policies, and OAuth2 providersUsers and memberships
FunctionsFunctions, their variables, and their active deploymentEvery deployment
SitesSites, their variables, and their active deploymentEvery deployment
MessagingProviders and topics
SettingsPlatforms, SMTP, enabled services, project variables, and email templates

The copy covers TablesDB, DocumentsDB, and VectorsDB databases. A resource whose ID you chose, such as a database, table, bucket, or function, keeps that ID in the environment, so code that names a table by ID works in both.

What stays behind

A copy never includes:

  • API keys. Create new keys in the environment. A production key can't act in it.
  • Webhooks. Add the webhooks the environment needs, pointing at your test receivers.
  • Custom domains and domain rules. Hostnames belong to the project.
  • Messages already sent. Providers and topics are copied, not message history.
  • Backup policies and backups. Environments don't have backups.

Users

An environment holds at most 100 users. When you copy users, Appwrite copies the newest 90 with their password hashes, so copied accounts can sign in with the same passwords, and 10 places stay free for test accounts. Memberships of users who aren't copied are left out.

How the copy runs

The environment is created right away, and the copy runs in the background as a migration of the environment. In the Console, a card in the bottom-right corner shows its progress, and a failed copy links to the migration's details under the environment's Settings > Migrations.

A copy can't be repeated on an existing environment. To start over from production, delete the environment and create it again.

Copy with a server SDK

Pass the resource types to copy in resources when you create the environment with a server SDK. SDKs take them as values of the EnvironmentResource enum. A structural type such as database, table, column, index, bucket, team, function, or site copies the structure and its settings. Add row, document, file, user, membership, deployment, or site-deployment to copy what it holds.

GroupStructure typesData types
Databasesdatabase, documentsdb, vectorsdb, table, collection, column, attribute, indexrow, document
Storagebucketfile
Authteam, auth-methods, policies, oauth2-provideruser, membership
Functionsfunction, environment-variabledeployment
Sitessite, site-variablesite-deployment
Messagingprovider, topic, subscriber
Settingsplatform, smtp, project-variable, project-protocols, project-labels, project-services, project-email-template

Was this page helpful?

Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.