Migrating from v4.5.34 to v5 - Migrate to the next version of Invoiceninja option is not available

Hi there,
I have an older version on a self hosted Invoiceninja implementation (v4.5.34) which I wish migrate to a self hosted v5. The v5 implementation (docker) is ready on a new vm. However, v4.5.34 does not have “Migrate to the next version of Invoiceninja” option available anywhere under the settings.
The v4.5.34 is running on Ubuntu 18 so I’d rather not want to deal with OS upgrade, if possible. I tried upgrading php to 7.4 (which I believe is a requirement for upgrading to latest version of v4.5.50) on that Ubuntu 18, which turned out to be major pain.

Any recommendation on how I can proceed with the least painful way to complete the v5 migration?

Thank you

ck

Hi,

I suggest setting up a clean install of v4.5.50, then copy over the database and .env file to bring over your existing v4 data.

Once that’s working you can use the migration tool to migrate the data to v5.

**Thank you for the instructions. I have tried that path but failed in the end. **
I build a new vm with debian 12, php 8.2. Restored the application folder and sql data without any issues. I am not sure what else to do after this point as I am not able to find original v4 installation instructions. (the guides from Install — Invoice Ninja 4.5.50 documentation link didn’t give more than I implemented either).
I tried running composer installl with resulted in the errors below
===
composer install
Composer could not detect the root package (invoiceninja/invoiceninja) version, defaulting to ‘1.0.0’. See Troubleshooting - Composer
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run composer update or composer update <package name>.
Your lock file does not contain a compatible set of packages. Please run composer update.

** Problem 1**
** - asgrim/ofxparser is locked to version 1.2.2 and an update of this package was not requested.**
** - asgrim/ofxparser 1.2.2 requires php ~5.6|~7.0 → your php version (8.2.26) does not satisfy that requirement.**
** - …**
** - …**
** - …**
** ==========**
**I tried composer update which resulted in **

Composer could not detect the root package (invoiceninja/invoiceninja) version, defaulting to ‘1.0.0’. See Troubleshooting - Composer
Loading composer repositories with package information
GitHub API limit (60 calls/hr) is exhausted, could not fetch https://api.github.com/repos/hillelcoren/l5-google-cloud-storage. Create a GitHub OAuth token to go over the API rate limit. You can also wait until 2024-12-01 14:42:45 for the rate limit to reset.

When working with public GitHub repositories only, head here to retrieve a token:
Sign in to GitHub · GitHub
This token will have read-only permission for public information only.
When you need to access private GitHub repositories as well, go to:
Sign in to GitHub · GitHub
Note that such tokens have broad read/write permissions on your behalf, even if not needed by Composer.
Tokens will be stored in plain text in “/home/bnadmin/.config/composer/auth.json” for future use by Composer.
For additional information, check Authentication for privately hosted packages and repositories - Composer
Token (hidden):

=====================

invoiceninja is installed under /var/www/invoice-ninja folder.

Not sure where to go from here. Are there specific instructions for this 4.5.34 to 4.5.50 upgrade process?

Thank you

ck

If you use the release zip you don’t need to use composer, it includes all of the vendor files.

https://download.invoiceninja.com/

I have followed the instructions from the link below to install a fresh copy of the 4.5.5 version of the application on ubuntu 22.04 with apache server.

cat /etc/os-release
PRETTY_NAME=“Ubuntu 22.04.5 LTS”
NAME=“Ubuntu”
VERSION_ID=“22.04”
VERSION=“22.04.5 LTS (Jammy Jellyfish)”
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL=“https://www.ubuntu.com/
SUPPORT_URL=“https://help.ubuntu.com/
BUG_REPORT_URL=“Bugs : Ubuntu
PRIVACY_POLICY_URL=“Data privacy | Ubuntu
UBUNTU_CODENAME=jammy

php -v
PHP 8.1.2-1ubuntu2.19 (cli) (built: Sep 30 2024 16:25:25) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2-1ubuntu2.19, Copyright (c), by Zend Technologies

apache2 -v
Server version: Apache/2.4.52 (Ubuntu)
Server built: 2024-07-17T18:57:26

mariadb --version
mariadb Ver 15.1 Distrib 10.6.18-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper

All went well until (apache default page comes up OK at this point)

sudo php8.1 /var/www/invoice-ninja/artisan key:generate

which resulted in;

sudo php8.1 /var/www/invoice-ninja/artisan key:generate
PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Support/Collection.php:1277
Stack trace:
#0 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Support/Collection.php(11): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /var/www/invoice-ninja/vendor/composer/ClassLoader.php(444): include(‘…’)
#2 /var/www/invoice-ninja/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile()
#3 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Support/helpers.php(109): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(89): collect()
#5 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(78): Illuminate\Foundation\PackageManifest->config()
#6 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php(26): Illuminate\Foundation\PackageManifest->aliases()
#7 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(219): Illuminate\Foundation\Bootstrap\RegisterFacades->bootstrap()
#8 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(320): Illuminate\Foundation\Application->bootstrapWith()
#9 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Foundation\Console\Kernel->bootstrap()
#10 /var/www/invoice-ninja/artisan(35): Illuminate\Foundation\Console\Kernel->handle()
#11 {main} in /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Support/Collection.php on line 11

In Collection.php line 11:

During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either
be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily
suppress the notice in /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Support/Collection.php:1277
Stack trace:
#0 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Support/Collection.php(11): Illuminate\Foundation\Bootstrap\HandleExcepti
ons->handleError()
#1 /var/www/invoice-ninja/vendor/composer/ClassLoader.php(444): include(‘…’)
#2 /var/www/invoice-ninja/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile()
#3 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Support/helpers.php(109): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(89): collect()
#5 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(78): Illuminate\Foundation\PackageManifest
->config()
#6 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php(26): Illuminate\Foundation\Packa
geManifest->aliases()
#7 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(219): Illuminate\Foundation\Bootstrap\Register
Facades->bootstrap()
#8 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(320): Illuminate\Foundation\Application->bo
otstrapWith()
#9 /var/www/invoice-ninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Foundation\Console\Kernel-

bootstrap()
#10 /var/www/invoice-ninja/artisan(35): Illuminate\Foundation\Console\Kernel->handle()
#11 {main}

Apache config points to correct folder which is /var/www/invoice-ninja/public
but when I browse into it, I get a blank page (even with /setup) in Firefox but in Chrome it resultsin;

This page isn’t working

invoice455u.mydomain.com is currently unable to handle this request.

HTTP ERROR 500

I have tried this couple of times with same results.
Should I try php8.2?
are there a different installation instruction?

If I can finish the base installation, I will restore the database from the original server. (v4.5.34)

Thank you

ck

I think you need to use PHP 7.4

I have managed to get the login screen after installing v4.5.50 and restoring the db and using the same parameters from the original .env file in the new .env file. I accepts my username and password, then I entered the 2FA code after which point it throws the 500 Server Error.

ck

Are there any details about the 500 error in storage/logs?

I have managed to log in. I disabled 2FA on the original (v4.5.34), re-dumped sql and restored into the new one (v4.5.50), then I was able to login without any issues.
Now onto migration to v5.

thank you

ck

When I navigated to the Account Management page on v.4.5.50, I noticed that the Migration section didn’t provide any option. The message reads;

We’ve been working on next version of Invoice Ninja. Click the button bellow to start the migration.

Watch these YouTube videos to see some of the many new features added:
What’s new in Invoice Ninja v5
More new features in v5

Sorry, you don’t have the needed permissions
Learn more

=======

Learn more link doesn’t work either.

Thank you

ck

Make sure you’re logging in as the owner of the account

That was it. I disabled the 2FA for the owner account, re-dumped and restored the sql data. I logged in to the new server (v.4.5.50) as the owner and the migrate option appeared.
I will start the migration process shortly.

Thank you

ck

1 Like