memos icon indicating copy to clipboard operation
memos copied to clipboard

data is missing when I upgrade the docker image

Open Kellermaan opened this issue 1 year ago • 2 comments

Describe the bug

Hi, I'm not sure what's wrong I'm doing here. I upgraded my docker image of memos, using the old data. when I finished the upgrade, all the memos are missing.

Steps to reproduce

just upgrade the docker image.

The version of Memos you're using

latest stable

Screenshots or additional context

No response

Kellermaan avatar Jun 20 '24 04:06 Kellermaan

Backup your database file so that your data is never lost.

And please provide more context or logs.

Zeng1998 avatar Jun 23 '24 11:06 Zeng1998

Did you create a volume within your docker setup for your data? Otherwise it's not persistent, as the docker manual states:

By default all files created inside a container are stored on a writable container layer. This means that:

  • The data doesn't persist when that container no longer exists, and it can be difficult to get the data out of the container if another process needs it.

RaphaelPour avatar Jun 24 '24 09:06 RaphaelPour

I've designated the file path for the persistent files. it just didn't work.

Kellermaan avatar Jul 17 '24 06:07 Kellermaan

How do you deploy the memos container? If you do it like stated in the memos docs, your data should be persistent. As usual with docker, there are two ways: docker run and docker-compose.

docker run

docker run -d \
  --init \
  --name memos \
  --publish 5230:5230 \
  --volume ~/.memos/:/var/opt/memos \
  neosmemo/memos:stable

docker-compose

services:
  memos:
    image: neosmemo/memos:stable
    container_name: memos
    volumes:
      - ~/.memos/:/var/opt/memos
    ports:
      - 5230:5230

RaphaelPour avatar Jul 18 '24 06:07 RaphaelPour

I used the first one. it's wired that the data are missing. But when I use the old version of image, the data are back. I'm thinking maybe there are some incompatible things happened here.

Kellermaan avatar Jul 18 '24 12:07 Kellermaan