Updates and migrations_
Keep your self-hosted Appwrite instance up-to-date. Learn how to perform updates, manage versions, and ensure your self-hosted Appwrite stays current.
3 min read
To upgrade your Appwrite server from an older version, you should use the Appwrite migration tool after you have installed the new version. The migration tool will adjust your Appwrite data to the new version's structure to make sure your Appwrite data is compatible with any internal changes.
You can upgrade to a newer patch version without running the migration unless the release notes indicate a migration is required. For example, you can upgrade from 1.6.0 to 1.6.1 without running the migrate command, but upgrading from 1.6.0 to 1.6.2 or later will require the migrate command because 1.6.2 requires a migration.
If you're trying to migrate to a newer minor version, you should upgrade to each minor version's latest patch. For example, if you're upgrading from 1.5.1 to 1.7.4 you should upgrade to:
1.5.111.6.21.7.4
Recent versions share a migration and can skip minor versions. The latest upgrade section names the oldest version that upgrades to the current release in one step. From an older version, upgrade to that version first.
Before upgrading, be sure to:
- back up your server data before running the migration
- review the changelog for any breaking changes
- test the migration process on a non-production instance to make sure your application is working well
Upgrading to 2.3.0
Appwrite 2.3.0 upgrades from 1.9.6 or any later version. Run the upgrade command with the 2.3.0 tag, then run the migration.
docker run -it --rm \ --publish 20080:20080 \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="upgrade" \ appwrite/appwrite:2.3.0Then run the migration from the appwrite directory.
cd appwrite/docker compose exec appwrite migrateThe migration drops the devKeys collection and project attribute from the console database, removes the dev key scopes from API keys, functions and sites, and in every project adds providerIdToken to identities and a passwordPwned attribute and index to users, restoring any missing email metadata attributes on the way. Its run time grows with the number of projects. The upgraded compose file adds an appwrite-mqtt container and has Traefik publish ports 8883 and 8084; set _APP_MQTT_PORT and _APP_MQTT_WSS_PORT in .env if those are taken. Remove _APP_CONSOLE_URL_SCHEME from your .env, and set _APP_CONSOLE_URL if your console is served from a different host than the API. To roll back to 2.2.0, stop the workers and let queued jobs drain first, since the older queue client can't recover jobs the new one has reserved. Back up your data first.
If you skip releases, also follow the upgrade notes of each release you skip: 2.0.0, 2.1.0, 2.2.0.
Installing the next version
The first step is to install the latest version of Appwrite. Head to the directory where you ran your previous Appwrite install command.
parent_directory <= you run the command in this directory└── appwrite └── docker-compose.ymlThe parent directory is where you will find the appwrite directory, inside which there are docker-compose.yml and .env files.
Your Appwrite installation's parent directory name is expected to be appwrite. Changing the directory name will result in mismatched Docker project names.
Replace <APPWRITE_VERSION> below with the specific Appwrite image tag you intend to run (for example, 2.3.0). Avoid using latest in production.
Unix
docker run -it --rm \ --publish 20080:20080 \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="upgrade" \ appwrite/appwrite:<APPWRITE_VERSION>CMD
docker run -it --rm ^ --publish 20080:20080 ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="upgrade" ^ appwrite/appwrite:<APPWRITE_VERSION>PowerShell
docker run -it --rm ` --publish 20080:20080 ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="upgrade" ` appwrite/appwrite:<APPWRITE_VERSION>This will pull the docker-compose.yml for the selected version/tag and perform the upgrade steps. Once the setup completes, verify that you have the latest version of Appwrite.
docker ps | grep appwrite/appwriteVerify that the STATUS doesn't have any errors and all the appwrite/appwrite containers have the same version.
Running the migration
We can now start the migration. Navigate to the appwrite directory where your docker-compose.yml is present and run the following command.
cd appwrite/docker compose exec appwrite migrateThe data migration can take longer depending on the amount of data your Appwrite instance contains. The Appwrite migration command uses multi-threading to speed up the process, meaning that adding more CPU cores can help speed up the process.
Once the migration process has been completed successfully, you're all set to use the latest version of Appwrite!
Was this page helpful?
Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.