V4 migration to V5

I have setup V5 and tried to migrate from V4 in its settings > Account management , migrations and it went well and got the following message
Migration has started. We’ll update you with status, on your company e-mail."

It’s been around 8 hours and no migrated data is being shown in V5.

Wondering how much time migration would take or is anything else that I may also try or check pls ?


That’s definitely not a normal period. Migration should take up to 10 minutes if you own a huge amount of data.

Can you tell us versions of your Invoice Ninja (v4 & v5)?


I get no any error message etc, but the data is never migrated to V5

Same problem here, from shared hosted server to shared host server with company details equal to old v4. I traced back the problem to this:(REMOVED is some personal details i had removed)

[2020-11-27 06:43:38] production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError [0] : /data/sites/web/REMOVED/app/Services/Migration/CompleteService.php [Line 54] => Type error: Argument 1 passed to App\Services\Migration\CompleteService::companyKey() must be of the type string, null given, called in /data/sites/web/REMOVED/app/Http/Controllers/Migration/StepsController.php on line 189 {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:“REMOVED”,“method”:“POST”,“user_agent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36 Edg/87.0.664.47”,“locale”:“nl”,“ip”:“REMOVED”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“migration/companies”} []

So i Tried to replicate my v4 app on ubuntu local server, imported the sql installed laravel and website is running great local, but migration give another error of ‘forge’@localhost user not allowed.

I really want migration to work so i can make my invoices again, i can use the old version for now but hope to find the answer here…

Right, I do not get any errors though and it says migration started successfully but i never see the data on new V5

Can you check your logs, please? You can find them in “storage/logs/laravel.log”. Also, in case you are unsure about what to look for, just PM them to me, here on the forum.

Also, what’s the value of QUEUE_CONNECTION in the .env file?

Now, that definitely looks like an issue with the migration scripts. We’ve recently pushed some new version of V4, can you upgrade & try again?


Okay thanks let me try that

Also since our V5 is running good so is it possible that we manually dump mysql database of V4 into V5 so that the data appears in V5? Is it possible or we must have to do it via migrations in settings from our pannel only ?

@fayaz no you can’t dump the databases, the V4 data model is very different to V5 hence incompatible.

Hi @ben and @david ,

I am a Senior Server Admin and deployed and migrated Invoice Ninja several times up to V4 version but this V5 migration is giving us hard time. Per your recommendations below is what we did plus some other things which we have tried too

So we have upgraded to your new version of V4 ( [v4.5.23) and tried the migration again but still there is same issue and migration never happens despite the message that “The Migration has Started Successfully” and we never see that in our V5 .

Also, There is no any QUEUE_CONNECTION entry in .env but through some research we tried to put QUEUE_CONNECTION=sync but that did not work too.
Below are the log files of V4.5.23 and V5.0.25

V4.5.23 Logs (storage/logs/laravel-info.log)

[2020-11-27 20:56:45] production.INFO: Undefined property: stdClass::$data [] []

V5.0.25 Logs (storage/logs/laravel.log)

#38 ninja5/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(87): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#39 ninja5/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#40 ninja5/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Middleware.php(45): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#41 /ninja5/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\Laravel\Tracing\Middleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#42 ninja5/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#43 /ninja5/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#44 /ninja5/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#45 //ninja5/public/index.php(57): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#46 {main}

Also, as a side note that on our V5 it says to enable cron jobs which we have already did but it still shows the same message for enabling crons, not sure if that may cause the migration ?

We already have this entry in our cron for our V5

          • cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
Also, Health Check of V5 shows that all is good 


We tried to force update V5.0.25 and it said we already have latest version but even we forced update it just to make sure or fix any minor updates etc and it went well. 


Your assistance in this regard is highly appreciated. Thank you


Do you want to try clearing the v4 error log and trying again. I don’t think the error shown is from the latest release, its date is from before the release was available. It would be useful to know if the v4 side of the migration is completing without errors.


This is a regression. We have changed the default filesystem storage point which has caused this issue.

A quick fix would be to uncomment line 63 of config/filesystems.php and then comment out line 64.

then run

php artisan optimize

We have a fix for this coming.

1 Like

Okay thanks , I will try and let you know the updates. Thanks again


line 63 and 64 config/filesystems.php of V4 or V5 ?

Line 63 and 64 on V4 reads as follows
‘s3’ => [
‘driver’ => ‘s3’,
‘key’ => env(‘S3_KEY’, ‘’),
‘secret’ => env(‘S3_SECRET’, ‘’),

Line 63 and 64 on V5 reads as follows

‘root’ => storage_path(‘app/public’),
‘url’ => env(‘APP_URL’).’/storage’,

There is not any commented code which needs to be uncommented, Please clarify , or pls end me updated file here so that i can directly upload it to my system. Thanks

v5.0.31 released which should resolve this.

Thanks, will try it out.

Hi @david,
Just tried updating it from Dashboard but its not updating. It shows some git error as attached in screenshot below


do you have git installed on your server?


Package git- already installed and latest version

@fayaz, how did you install the app?

For the self update to work, you would have need to either clone the repo. OR use the invoiceninja.zip file from the releases. These two options contain the .git history.

If you install from Docker or if you just copy the regular release.zip’s these don’t have the git history so won’t be able to use the self update mechanism.