Problem with upgrade (selfhosted invoiceninja 4.5.31)

Hi,

I want to migrate InvoiceNInja from version 4.5.31 to the latest version.
In the documentation, I read that I need to first upgrade the current version to 4.5.50
I also read that to do this, I need to copy the files of version 4.5.50 to the folder with the earlier version, overwriting what is necessary.
After overwriting, I would need to delete the cache and run https://domain.pl/update?clear_cache=true
Unfortunately, after this operation I get the info Error 404.
I tried another way. Since the .env file contains the configuration, I made a copy of the 4.5.50 files under the new domain and completed with the .env file of the original version, correcting only the domain info.
Unfortunately, there is an Error 500 error in this case as well.

In general, I only care about transferring data from version 4.5.31 to the latest 4.8.21

Any suggestions?

Hi,

Please share the details of the 500 error from storage/logs

After overwriting according to the instructions:
https://invoice-ninja.readthedocs.io/en/latest/update.html
and calling
composer dump-autoload --optimize

An error appears in the terminal: [ErrorException].
Class ‘Google_Service’ not found

And calling https://faktury.mc2.pl generates a redirect to https://faktury.mc2.pl/setup and error 404
and laravel.log is empty.

The Google_Service message is a warning and can be ignored.

You may want to try setting up a new v4 install and then copy over the database and .env file?

Your suggestion gave me a hint on how to solve the problem.
I installed version 4.5.50 from the hosting installer and swapped databases after running it.
I managed to do both the update and migration to the latest version.

Unfortunately, I have another problem. Invoice numbering is not working properly.
In “Generated numbers” I have set:
Number padding: 01
Generate. number : When Saved
Reset Counter : Annually
Next reset 01-01-2025

In invoices:
Number pattern: {$counter}/{$date:m/Y}-{$clientCounter}/{$clientIdNumber}.
Number counter 48

Unfortunately it starts counting numbers from 1 i.e. 01/02/2024…- while it should 48/02/2024…
The question is how to correct this?

If you think there’s a bug I suggest creating an issue on GitHub.

I have tested several variants and I think that either there is a duplication of markings or an error.
When I have {$counter} and {$client_counter} then in both places it enters the value from {$client_counter} which counts the number of invoices generated that day, I think.
In a situation where there is only {$counter} without {$client_counter} the next invoice number taken from the Number counter field is inserted.