V4 database to v5 new install

Had a complex failure when moving Self hosted v4 to new hosting provider.
i decided to installed a new v5 installation and import CSV files extracted from the v4 DB.

All went till i got to the invoice table. The structure of v5 invoice table is different to the v4 invoice table with different and missing fields.
Any suggestion how i can import a CSV file from v4 to v5 please?
Sorry I am very new to this application. TIA

Hi,

To upgrade from v4 you need to install v5 as a separate app and then use the migration tool in the latest version of v4 on Settings > Account Management. If you have a backup of your v4 database then I suggest setting up a new v4 app to migrate from.

Hi Hiltel, Thank you for your reply and help. I have tried to install v4 and will try once more but I received the "Whoops , looks like something went wrong” message. i did set php to 7.2 btw also.

Is there no way to install V5 and migrate the V4 DB over?

Are there any details about the error in storage/logs/, make sure you also copy over the .env file.

Not that I’m aware of, we built the migration to handle this.

Hillel, where can i find a copy of self hosted zipped v4 to install?

Hillel, I installed a new V4 installation and get the "Whoops , looks like something went wrong” message.
here is the log file. would you mind casting an eye over the log to see where my installion is falling over please? thanks for any help

[2021-05-14 21:03:13] production.ERROR: ErrorException [0] : /home/stantec1/public_html/invoice1/app/Models/Account.php [Line 1126] => Unparenthesized a ? b : c ?: d is deprecated. Use either (a ? b : c) ?: d or a ? b : (c ?: d) {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“GET”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15”,“locale”:“en”,“ip”:“151.226.223.31”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:"/"} []
[2021-05-14 21:03:48] production.ERROR: ErrorException [0] : /home/stantec1/public_html/invoice1/app/Models/Account.php [Line 1126] => Unparenthesized a ? b : c ?: d is deprecated. Use either (a ? b : c) ?: d or a ? b : (c ?: d) (View: /home/stantec1/public_html/invoice1/resources/views/auth/login.blade.php) {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“GET”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15”,“locale”:“en”,“ip”:“151.226.223.31”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“login”} []

It looks like you may be using PHP 7.4, changing to 7.3 should resolve the error

Hillel, thank you so much for your help. you were spot on. got my v4 working now to upgrade to v5.

1 Like

Hillel, i am having an issue with setting different PHP versions on the same hosting account. Does V5 need to be running when migrating process starts? Does the migrating process produce a file to import into v5? sorry for the odd questions and thank you for helping.

v5 needs to be setup to start the migration

Yes, a JSON file is used to transfer the data

Thank you again for your prompt reply. so if i have a new install of v5 running and the migration process is started, does V4 need to be running at the same time?

Yes, both apps need to be setup

1 Like

I am trying so hard to migrate v4.5.38 to v5.1.61 and just keep hitting a wall and not getting far at all. It so frustrating.
I recovered my broken v4 and have both v4 & v5 setups running. self hosted

  • Both on different domains v4 - PHP7.2; v5 - PHP7.4 same server.

  • 3 error logs laravel-error.log; laravel-info.log; stack trace.log

  • no migration folder setup.

  • checked both credentials are the same.

  • start the migration on v4 and i get

  • “Cross account migration is not allowed. Please read more about it here: Free Open-Source Invoicing, Expenses & Time-Tracking | Invoice Ninja”

  • check the troubling shooting. it’s not been helpful.

anyone able to help and advise before i give up please? thanks

Hi,

@david any thoughts?

Are you using the same email and password in v4 and v5?

V4 and V5 need to have identical credentials configured.

1 Like

Yes, have the same. Nothing to do with using the same server but different domains? Can I migrate using php admin? I only have a few clients and invoices.

thanks David & Hillel, i am making progress. i got the migration started but didn’t use “Force”. the V5 data base is filled with correct data but i don’t see anything in the from end. I didn’t receive an email? my company & invoice is small. How long do i need to wait for the process to complete? thank as always.

Maybe you need to change companies?

There’s more info here which may help:

https://invoiceninja.github.io/docs/migration/#troubleshooting

1 Like

great work and software guys. thank you for your hard work.