Simple instructions for Joplin server upgrade

I installed the docker Jopiln server using these instructions:

(version 1.8.5)

Is there a simple way to upgrade the server without losing data/notes?

This topic was discussed a lot in another thread and I still don't know if I got everything right. As I understood it, if you use the original Docker Version by laurent, the database is not persistent, so you lose your sever data on an update. The version that I linked in the guide is the inofficial one by florider and his version has got a persistent database, so you can (and I already did it serveral times) really easy follow the 10th step on the guide and won't lose any data.

1 Like

Well, did that with florider version and all data was wiped out (empty directories). Fortunately I took a backup but returning it is a loooong process (I have ~10k notes). Dang.

Hm, so I did it several times without loosing data...did you upgrade from 1.x to 2.x?

Yes 1.x -> latest.

kjwiik@hajala:~/joplin-server$ docker-compose down
Stopping joplin-server_app_1 ... done
Stopping joplin-server_db_1  ... done
Removing joplin-server_app_1 ... done
Removing joplin-server_db_1  ... done
Removing network joplin-server_default

Database and data was wiped out.

image: florider89/joplin-server:latest

I think this is very bad behaviour: every time you have to upgrade, everything is wiped out. I makes not much sense because I guess data format does not change.

I restarted the server and everything looks normal except for an error

2021-06-30 14:28:50: [error] App: TypeError: Cannot read property 'id' of null

It repeats every couple of minutes, probably not related to this problem.

As written on the docker page by florider89:

Note that data will not be migrated - and you need to start fresh again as explained in the forum post.

Again: The Database is persistent in those versions. But from v1 to v2 the location where the data is being stored changed.

Ah, I have missed that page, so data is preserved between minor versions but not major. Thanks for the clarification. The new version seems to be working ok. By the way, is there a way to get the version of the server?

Now I got the

Not allowed: PUT (Code 400)

error. Doh...

Joplin 2.1.7 (prod, linux)

Client ID: 6d6d2b5eb2c94cbdb6b702ea92087ca8
Sync Version: 2
Profile Version: 39
Keychain Supported: No

Revision: 04c4015
1 Like

I tried to

kjwiik@hajala:~/joplin-server$ docker-compose down
Stopping joplin-server_app_1 ... done
Stopping joplin-server_db_1  ... done
Removing joplin-server_app_1 ... done
Removing joplin-server_db_1  ... done
Removing network joplin-server_default

and again all settings (new user) was lost. This does not look very deterministic?

It seems that the florider image is not working at all anymore, next I'll dump it and try the 'official' one.

1 Like

It seems (also from a couple of threads in Discourse) that the correct incantation in docker-compose.yml at the moment is

    app:
        image: joplin/server:2.1.6-beta

Now everything seems to work except I get (possibly harmless) error messages like

app_1  | 2021-07-01 09:24:59: [error] App: 404: GET /api/files/root:/notes/.sync/version.txt:/content : Path not found: api/files/root:/notes/.sync/version.txt:/content
app_1  | 2021-07-01 09:24:59: [error] App: 400: POST /api/files/root:/notes:/children : Not allowed: POST 
app_1  | 2021-07-01 09:24:59: App: POST /api/files/root:/notes:/children (1ms)
app_1  | 2021-07-01 09:25:03: [error] App: 400: POST /api/files/root:/notes:/children : Not allowed: POST 
app_1  | 2021-07-01 09:25:03: App: POST /api/files/root:/notes:/children (1ms)

Shouldn't it be version 2.1.7?

That is the desktop client release, not server release.

See:

https://hub.docker.com/r/joplin/server/tags?page=1&ordering=last_updated

Or the release tags starting with server-

Yes, be careful with different versions of server and client.

Now there is another problem: after I tried to share a note (maybe coincidental) the client (2.1.7) started to sync and now it is in round five. It also created hundreds of dummy notes labeled "Untitled". I went to version 2.0.11 and the Untitled notes went away but it is continuing to resync indefinitely.

This does not look very promising.

Now 2.0.11 stopped resyncing and note sharing seems to work. Let's see what happens when more clients are added...

But web clipper doesn't work with 2.0.11 doh...

Closer to a working solution:

@KajWiik I've been trying to get the Docker Version working on our server, would you be able to share your docker-compose.yml or process to help?

I'm on Windows and I have had problems.

@cybrpimp Yes, sure. It is basically the 'official' docker file from joplins github repo:

This is the version I am using:

# This is a sample docker-compose file that can be used to run Joplin Server
# along with a PostgreSQL server.
#
# All environment variables are optional. If you don't set them, you will get a
# warning from docker-compose, however the app should use working defaults.

version: '3'

services:
    db:
        image: postgres:13.1
        volumes:
            - /YOUR_PATH/joplin-data:/YOUR_PATH/postgresql/data
        ports:
            - "5432:5432"
        restart: unless-stopped
        environment:
            - APP_PORT=22300
            - POSTGRES_PASSWORD=joplin
            - POSTGRES_USER=joplin
            - POSTGRES_DB=joplin
    app:
        image: joplin/server:2.1.6-beta
        depends_on:
            - db
        ports:
            - "22300:22300"
        restart: unless-stopped
        environment:
            - APP_BASE_URL=https://YOUR_SERVER_NAME/joplin
            - DB_CLIENT=pg
            - POSTGRES_PASSWORD=joplin
            - POSTGRES_DATABASE=joplin
            - POSTGRES_USER=joplin
            - POSTGRES_PORT=5432
            - POSTGRES_HOST=db

Note the line

image: joplin/server:2.1.6-beta

You have to use absolute version, latest will not bring the latest one :frowning: .

Set data path appropriately, in my setup it is the raid mount point.
Also you have to set up port forwarding with your web server.
This setup is working very well at least in Ubuntu 20.04 and with the latest desktop apps (2.1.8 in Linux).