Back

External volume issue after Restore with backup/restore scripts

  • 0
  • Self Hosted
Gildas Quiniou
19 Apr, 2023, 12:41

Hi, I used the suggested backup/restore script (from Meldiron: https://gist.github.com/Meldiron/47b5851663668102a676aff43c6341f7) in which the restore process needs to have a clean server that either didn't run the appwrite yet or have it removed with docker-compose -v to delete the volumes. The issue is that the restoration process creates the volumes back but they are not tied to any docker-compose configuration. Then when I docker-compose up, it (kindly) complains about volumes already existing and suggest to add en external option in the docker-compose.yml. Any suggestion to prevent this? Thx.

TL;DR
The user is experiencing an issue with their external volumes after using a backup/restore script. The script requires a clean server and deletes the volumes, resulting in the volumes not being linked properly to the Docker Compose configuration. A possible solution is to add the "external: true" option to all the volumes in the Docker Compose file. This can be done by editing the "volumes" section and specifying "external: true" for each volume. After making this change, the user should rerun the Docker Compose command.
Binyamin
19 Apr, 2023, 12:43

Try to add external: true to all the volumes

TypeScript
volumes:
  appwrite-mariadb:
    external: true
  appwrite-redis:
    external: true
  appwrite-cache:
    external: true
  appwrite-uploads:
    external: true
  appwrite-certificates:
    external: true
  appwrite-functions:
    external: true
  appwrite-builds:
    external: true
  appwrite-influxdb:
    external: true
  appwrite-config:
    external: true
  appwrite-executor:
    external: true

Then rerun

Gildas Quiniou
19 Apr, 2023, 16:38

Sure, that is what docker compose suggest, but that is not what I would like to do... my volumes are NOT external, they are tied to my docker stack...

Binyamin
19 Apr, 2023, 16:39

Of course External just means that you have set them before the docker-compose file Not external filesystem

joeyouss
19 Apr, 2023, 16:47

hey @Meldiron can you take a look at this from your script?

Binyamin
19 Apr, 2023, 16:47

You actually correct that's sound wired What is the output of

TypeScript
  docker volume ls
Gildas Quiniou
19 Apr, 2023, 17:39

In fact it's kind of normal as the volumes are created by the restore script, but the script requires this :

TypeScript
# Make sure the Appwrite did NOT run on this server previously,
# and make sure to stop it before this restore.
# If appwrite ran here already, make sure to
# stop Appwrite with 'docker-compose down -v', and ideally
# also remove appwrite folder.

Doing so I'm ending with a clean server on which the script is restoring, creating new volumes but losing the compose link. It's finally working well, but a docker volume inspect clearly shows that it's missing the "link". Here is from a docker-compose install :

TypeScript
[
    {
        "CreatedAt": "2023-02-26T18:16:04Z",
        "Driver": "local",
        "Labels": {
            "com.docker.compose.project": "appwrite",
            "com.docker.compose.version": "2.5.0",
            "com.docker.compose.volume": "appwrite-certificates"
        },
        "Mountpoint": "/docker/var/lib/docker/volumes/appwrite_appwrite-certificates/_data",
        "Name": "appwrite_appwrite-certificates",
        "Options": null,
        "Scope": "local"
    }
]

and after a restore (note the missing "Labels" that maintain the docker-compose source) :

TypeScript
[
    {
        "CreatedAt": "2023-04-19T13:07:31Z",
        "Driver": "local",
        "Labels": null,
        "Mountpoint": "/var/lib/docker/volumes/appwrite_appwrite-certificates/_data",
        "Name": "appwrite_appwrite-certificates",
        "Options": null,
        "Scope": "local"
    }
]

BTW, the above samples come from 2 different platforms but I got the same before/after changes on the same server.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more