#Help understanding what "upgrade" and "migrate" do

7 messages · Page 1 of 1 (latest)

crystal seal
#

Hello,
I'm currently running appwrite with k8s (well, a dirty "hack" of converting each container to a deployment). And I have some trouble understand what "upgrade" do in this doc:
https://appwrite.io/docs/advanced/self-hosting/production/updates

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.

Well, since k8s (or in my case I'm running a k3s instance) is running with containerd, I think this "upgrade" will fail.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: appwrite
  namespace: appwrite
  annotations:
    keel.sh/policy: "glob:v*-1.8.x"
    keel.sh/trigger: poll
    keel.sh/pollSchedule: '@weekly'
spec:
  replicas: 1
  selector:
    matchLabels:
      app: appwrite
  template:
    metadata:
      labels:
        app: appwrite
      annotations:
        backup.velero.io/backup-volumes: appwrite-config,appwrite-uploads,appwrite-functions,appwrite-sites,appwrite-builds
    spec:
      imagePullSecrets:
      - name: pull-creds
      containers:
      - name: appwrite
        image: my.private.registry/username/appwrite:v1.1.0-1.8.x

Here is what my deployment file looks like. I'm manually build appwrite form 1.8.x branch, and have CI/CD pipeline to upgrade image (newly built with latest commit from 1.8.x branch). Things works fine so far WITHOUT upgrade or migrate commands. But I'm worry about potential issue in the future if just leave it like this.

so

  1. what does "upgrade" command do? is it the same as pull new code from appwrite/appwrite->build-> deploy to docker container?
  2. I perhaps can run "migrate" before appwrite run, or does it need to be run as the same time as appwrite (new version) running?

Keep your self-hosted Appwrite instance up-to-date. Learn how to perform updates, manage versions, and ensure your self-hosted Appwrite stays current.

lament moth
#

upgrade -> upgrade appwrite instances from an older version to new. example: 1.6.x > 1.7.x, etc.

migrate -> migrating the internal data structure for databases for addition of new features on existing services or addition of new services altogether. This is required so that when you upgrade, your data structure inside the underlying database is up to date with backend sources.

crystal seal
# lament moth `upgrade` -> upgrade appwrite instances from an older version to new. example: 1...

Sorry im not quite get what you meant there:

  1. so upgrade is the same as me pulling the new appwrite image and re'deploy it on container? What is the

"upgrade appwrite instances"
Can you be more specific? Is there any internal "db structure" changes be made? Or just new appwrite code? (I saw you guys mount /usr/src/code/appwrite in the example). If it just new code, how is it different for me to git pull, and just run with new image? (without run upgrade)

  1. Yes, but that doesnt answer my question. Can i run migrate "before" appwrite is up? Or is it required appwrite already running?
crystal seal
#

you know what, forget bout it, I found the work around

Edit: ok no, the workaround may not works, I need help

crystal seal
#

ye, so I checked, I can run "migrate" just fine, but upgrade I can't (because k3s is using containerd, not dockerd)

unreal vessel
#

I don't believe the migrate command will work if Appwrite isn't running, as it needs to be able to talk to the database. However, you may be able to just run the mariadb container, and not the rest of Appwrite - it looks like it talks to the DB directly.