Best way to migrate/upgrade

I currently have a VPS with 2 v4.5.44 installs on it. The VPS is acting up and I cannot get remote SSH to work so I have to use the remote console which is a royal PITA. I am looking to migrate my two v4 installs to my Docker setup. I also want to utilize my NGINX Proxy Manager to proxy the stuff over to the docker containers. I have tried unsuccessfully in the past to migrate from v4 to v5 and even to a v4 to v4 direct copy. I am assuming it was mostly because I was running through the NPM and Invoice Ninja already has a proxy (Caddy or Nginx) itself.

What would be the best/most direct way to make this happen without reinventing the wheel?

Second part, is the upgrade to v5 better now? Not sure how much longer v4 will be supported but last time I tried v5 it was a hot mess.

Hi,

That’s an older version of v4, you’ll want to update to the latest version before migrating.

https://invoice-ninja.readthedocs.io/en/latest/update.html

At the time I tried upgrading I was current. It was probably 6+ months ago I tried but ultimately ended up sticking with my self hosted v4 install. I tried upgrading about a month or so ago and it broke more stuff on my v4 instance so I have been sticking with the version I am on for now. I will try upgrading again and see what happens.

Any input on how to get it going behind my NPM proxy and not rely on the caddy or its own nginx? I guess I am just clueless on that part.

You may want to setup a clean v4 install and copy over the .env file and database using mysqldump

It may help to add TRUSTED_PROXIES=* to the .env file

https://invoiceninja.github.io/docs/env-variables/

Yeah, when I update to 4.5.49 I get the error:
Error: app is already configured, backup then delete the .env file to re-run the setup.

When I do that I get a totally new instance, none of my old data is there but is still in mysql and such.

I will try the clean instance of v4 and see what happens. Thanks!

Fixed the error when upgrading by putting single quotes around my DB_PASSWORD in the .env file as found here: Up date error 4.5.46, Please Help to fix - #3 by NZNinja. Now I can focus on getting a clean install setup.

2 Likes