linuxserver / docker-nextcloud

GNU General Public License v3.0
677 stars 128 forks source link

[BUG] converting sqlite to postgresdb #441

Open eisvogelETH opened 3 weeks ago

eisvogelETH commented 3 weeks ago

Is there an existing issue for this?

Current Behavior

image Unfortunately I am not able to convert the sqlite to a postgres db with the comment below...

Expected Behavior

working migration

Steps To Reproduce

try to migrate linuxserver/nextcloud (tried to upgrade to the tag latest 4h ago (29.0.2) and still not working

Environment

- OS: ubuntu 22.04 lts
- How docker service was installed:

CPU architecture

x86-64

Docker creation

nextcloud:
    image: lscr.io/linuxserver/nextcloud:latest
    container_name: nextcloud
    environment:
      - PUID={{ puid }}
      - PGID={{ pgid }}
      - TZ={{ timezone }}
    volumes:
      - "{{ docker_dir }}/nextcloud/appdata:/config" 
      - "{{ docker_dir }}/nextcloud/data:/data"
    restart: unless-stopped
    depends_on:
      - nextcloud-db
    links:
      - nextcloud-db
    ports:
      - '4443:443'

  nextcloud-db:
    image: postgres:15
    restart: always
    container_name: nextcloud_db
    environment:
      - POSTGRES_USER={{ nextcloud_user }}
      - POSTGRES_PASSWORD={{ nextcloud_pw }}
      - POSTGRES_DB={{ nextcloud_db }}
    volumes:
      - "{{ docker_dir }}/nextcloud/db:/var/lib/postgresql/data"
    healthcheck:
      test: ["CMD-SHELL", "sh -c 'pg_isready -U {{ nextcloud_user }} -d nextcloud'"]
      interval: 10s
      timeout: 3s
      retries: 3

Container logs

docker exec -it nextcloud bash
root@xxxx:/# occ db:convert-type --port 5432  --all-apps  --password=XXXXX pgsql user host db

In ConvertType.php line 183:

  This command is temporarily disabled (until the next maintenance release).  

db:convert-type [--port PORT] [--password PASSWORD] [--clear-schema] [--all-apps] [--chunk-size CHUNK-SIZE] [--] <type> <username> <hostname> <database>
github-actions[bot] commented 3 weeks ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

j0nnymoe commented 3 weeks ago

That seems more like something nextcloud disabled rather than anything to do with us.

Investigamer commented 2 weeks ago

Is there a nextcloud version you can safely revert to in order to convert your database, then jump back to latest? I also picked a terrible time to finally switch to postgres unfortunately.

joshtrichards commented 1 week ago

@Investigamer Anything <29. But you can't downgrade so it would have to be using a database snapshot from prior to upgrading to v29.

Context: This command was disabled very recently (in 29.0.1). So alternatively, If you can wait another maintenance release cycle or two (maintenance releases are published at least monthly), things should be back to normal and you'd be able to do the conversion without making other changes or reverting to an old backup.

Whatever you do, don't try doing it with 29.0.0. This command was disabled intentionally for the 29.0.1 release to prevent people inadvertently stumbling onto a data loss regression in this command that arose from some other v29 specific db change work.

johnny2678 commented 1 week ago

wow, bad timing.

Need to save off my occ command so I don't have to spend 15 minutes constructing it next time 😂

eisvogelETH commented 1 week ago

thank you for the replies guys! I guess i can close the issue now that we have a solution to this?

Investigamer commented 3 days ago

Thanks for the responses fellas. Just saw a new Nextcloud maintenance version has gone out, does anyone know if this was fixed in 29.0.3? Scouring the changelog, see some mention of changes with occ but nothing specific to this issue at first glance.

EDIT: Not resolved, currently marked for maintenance release 29.0.4, you can follow current progress here.

You might wanna keep this thread open till they resolve this issue so people can track the progress, if not feel free to lock it. Kinda weird they let this go 2 more maintenance releases without a resolution, its a major inconvenience 😅