Organizr 2.0 -> 2.1 Migration Guide

With Organizr v2.1 the API has been rewritten along with the core Organizr code to follow OOP.  With that being said, You will need to add a new location block to your webserver...  Along with that change, if you were using Nginx's Auth_Request module, you will need to update that address as well.

Prerequisites

DOCKER USERS

First of all, if you are using an Organizr docker container, please make sure you are using the new Organizr Image:

https://github.com/Organizr/docker-organizr#migration

organizr:
    container_name: organizr
    hostname: organizr
    image: organizr/organizr
    restart: unless-stopped
    ports:
        - 80:80
    volumes:
        - /home/organizr:/config
    environment:
        - fpm=true #true or false | using true will provide better performance
        - branch=v2-master #v2-master or #v2-develop
        - PUID=1000
        - PGID=1000
        - TZ=${TZ}

If you are using or you have now switched over to this container, you will not need to add the new api location block as that has been added for you in the container image.  If you are using Nginx's Auth_Request module, you will need to update that address by following these instructions: HERE

Note: the branch variable will take short hand such as master instead of v2-master and dev or develop instead of v2-develop as may be seen in the tag migration examples.

 

NON-DOCKER USERS

We will need to update your webserver to include the new API location block.

API location block

This is only needed on the actual webserver that is running Organizr | If you reverse proxy Organizr to another Webserver - do not add to that server.  Only add to the webserver that hosts Organizr.

Nginx

Please include this location block within the server block that houses Organizr.

location /api/v2 {
	try_files $uri /api/v2/index.php$is_args$args;
}

If you are using Nginx's Auth_Request module, you will need to update that address by following these instructions: HERE

Apache

RewriteEngine On
RewriteBase /api/v2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /api/v2/index.php [QSA,L]

Caddy v2

rewrite /api/v2/* /api/v2/index.php?{query}

 

Nginx Auth_Request

You will need to update your url for the auth_request module.

Notice the position of the ? and & signs

Subdirectories

Change from this line:
rewrite ^/auth-(.*) /api/?v1/auth&group=$1;

Change to this line:
rewrite ^/auth-(.*) /api/v2/auth?group=$1;

The complete config block will look like this:

location ~ /auth-(.*) {
	rewrite ^/auth-(.*) /api/v2/auth?group=$1;
}

 

Subdomains

Change from this line:
proxy_pass http://organizr-upstream/api/?v1/auth&group=$1;

Change to this line:
proxy_pass http://organizr-upstream/api/v2/auth?group=$1;

The complete config block will look like this:

location ~ ^/auth-(.*) {
	## Has to be local ip or local DNS name or if Proxied use proxy address
	proxy_pass http://organizr-upstream/api/v2/auth?group=$1;
	proxy_pass_request_body off;
	proxy_set_header Content-Length "";
}

 

Jellyfin & Emby

We have separated Jellyfin from Emby.  Please head to the homepage item section and fix accordingly.  If you are using Jellyfin for authentication, please edit the Authentication settings and input your URL and Token respectively.

 

Troubleshooting

Nothing loading at all/Blank Organizr

If your Organizr is totally blank or you see 404's in the Browser Console (F12) then more than likely you did not perform the API location block addition at all or correctly.  Please refer to the changes above for the appropriate webserver.

Settings/Homepage won't load

If you cannot access the settings/homepage page in Organizr - more than likely the tab url updater didn't run successfully.

Head over to your browser and type in the following:

http://<organizr-url>/api/v2/update/migrate/2.1.0

Once you hit enter you should get the following response:

{
    "response": {
        "result": "success",
        "message": "Ran update function for version: 2.1.0",
        "data": null
    }
}

Now you can go back to Organizr and reload if you haven't and check the settings/homepage page.

Custom Homepage Items Missing

There was a type on the there config item keys.  There are a total of 4 of them.  Goto the file /api/config/config.php and change these four keys from the left side of the image to the right side of the image.  All that was missing was the letter e

image-1598799936499.png


Revision #19
Created Thu, Aug 27, 2020 7:34 PM by CauseFX
Updated Wed, Oct 28, 2020 3:42 AM by CauseFX