Best Way to migrate to V5

i am already on

Already on ‘v5-stable’
Your branch is up to date with ‘origin/v5-stable’.

I would like to reset all the configuration / database and start the as if it is the first time i set it up, so i can set the database / initial user etc…

you should be able to just run

php artisan migrate:fresh --seed

and then run /setup again to create the first account.

@david

I have ran the php artisan queue:restart on the V4 (had to run with sudo as i got permissions denied error when i tried with my regular account)

Also i ran php artisan migrate:fresh --seed in the V5 to reset it and configured it from the scratch.

Created one user the identical to the default user at my V4 installation.

Tried the migrate, and now getting :slight_smile:
[2020-12-13 16:38:43] production.ERROR: ErrorException [0] : /var/www/html/ninja/app/Http/Controllers/Migration/StepsController.php [Line 260] => ZipArchive::close(): Failure to create temporary file: Permission denied {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:“George Wassef”,“method”:“POST”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 11_0_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36”,“locale”:“en”,“ip”:“My_IP”,“count”:2,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“migration/companies”} []

It doesn’t matter if i selected force migration or not.

@gerootech

This error indicates that your V4 app couldn’t write the .zip file, it is a permissions error , you need to ensure that /storage is writable recursively by the webuser.

@david thanks, i found the migration folder inside the storage folder was owned by root not the webuser. Once i changed this i was able to start the migration, however the message i got was we started the migration and we will send you an email once completed.

Email never came since yesterday, and when i log into the V5 deployment i find it has 2 new unnamed companies with no data.

no more errors were logged in the /storage/log/laravel-error.log though. Not sure how to troubleshoot this one.

@gerootech

Can you check the V5 logs also?

A few things to check.

  1. Have you setup your Task Scheduler Cron? This will fire the job on the queue.
  2. If you log into your database, in the jobs table, are there any records?

I forgot to add the crontab (had it there at some point and reverted back my server vm) now it is there. Do i need to start the migration again ??

Also here you are what i see in the v5 larvel.log (there is not error logs)
[2020-12-13 16:32:59] production.INFO:
[2020-12-13 16:33:25] production.INFO: latest version = 5.0.35
[2020-12-13 16:33:25] production.INFO: latest version = 5.0.35
[2020-12-13 20:44:24] production.INFO: migrations/lgqdp1x6uz93wrfc8f6tnyhvxcyogxjt-2020-12-13-invoiceninja.zip
[2020-12-13 20:44:24] production.INFO: migrations/1w7yqbxctnznmz98dbqfz4impkxldkf5-2020-12-13-invoiceninja.zip

Also the jobs table in the database has 13 records, but really don’t understand if they are related or not ( most probably not related, as i believe those are the records from the command i did earlier to initiate the setup again on my v5 installation) here you are the last record:

| 13 | default | {“uuid”:“a5d15de7-074e-402e-a1e4-4c2ee3c4a4ab”,“displayName”:“App\Listeners\User\UpdateUserLastLogin”,“job”:“Illuminate\Queue\CallQueuedHandler@call”,“maxTries”:null,“maxExceptions”:null,“backoff”:null,“timeout”:null,“retryUntil”:null,“data”:{“commandName”:“Illuminate\Events\CallQueuedListener”,“command”:“O:36:“Illuminate\Events\CallQueuedListener”:16:{s:5:“class”;s:38:“App\Listeners\User\UpdateUserLastLogin”;s:6:“method”;s:6:“handle”;s:4:“data”;a:1:{i:0;O:28:“App\Events\User\UserLoggedIn”:4:{s:4:“user”;O:45:“Illuminate\Contracts\Database\ModelIdentifier”:4:{s:5:“class”;s:15:“App\Models\User”;s:2:“id”;i:1;s:9:“relations”;a:0:{}s:10:“connection”;s:11:“db-ninja-01”;}s:7:“company”;O:45:“Illuminate\Contracts\Database\ModelIdentifier”:4:{s:5:“class”;s:18:“App\Models\Company”;s:2:“id”;i:1;s:9:“relations”;a:0:{}s:10:“connection”;s:11:“db-ninja-01”;}s:10:“event_vars”;a:3:{s:2:“ip”;s:9:“10.1.1.70”;s:5:“token”;s:64:“EwUaSmky5rLZPECbSxCkZQSaJhd1LDN5KSYGYEWGvmHmTOjmRUfR7qq009TIV7ka”;s:9:“is_system”;b:0;}s:6:“socket”;N;}}s:5:“tries”;N;s:7:“backoff”;N;s:10:“retryUntil”;N;s:7:“timeout”;N;s:3:“job”;N;s:10:“connection”;N;s:5:“queue”;N;s:15:“chainConnection”;N;s:10:“chainQueue”;N;s:19:“chainCatchCallbacks”;N;s:5:“delay”;N;s:10:“middleware”;a:0:{}s:7:“chained”;a:0:{}}”},“db”:“db-ninja-01”} | 0 | NULL | 1607958128 | 1607958128 |

as long as the cron is enabled, the migration should kick off.

Woow, that’s awesome, migration completed successfully after i added the cron job under the webuser account.

I am confirming the data now. That’s awesome thanks for helping out. Will check it in the coming few days and will let you know if i have further questions / issues.

When you guys are planing to have the first full staple release not a beta one ??

@gerootech

Awesome! Great to hear.

We have a check data script which can help ensure your data integrity is correct, from the command line run

php artisan ninja:check

You’ll get a whole bunch of output which should be descriptive.

I assume this is from the v5 folder?

I just noticed one thing didn’t migrate, which is the numbering for invoices and quotes they were set to start at 1.

Also editing users still giving me grey screen.

Ran the command and it says all zeros, except 1 failed job.

@gerootech in regards to invoice numbering, can you advise some example of what you expected your invoice number to be and what the actual result was?

The format of the numbers were already migrated, i am using the following format INV-{$year}-{$counter} formate for my invoices.

The expected next invoice number was suppose to be 33 however when i am checking the settings for the invoices generated numbers was set to 1, instead of 33.

Also i cannot find the option to reset the invoice numbers as on V4, is this still an option ??

In regards to invoice numbers, i think you’ll find the next time you create a invoice it will calculate the next number correctly…

@hillel can advise the status on resetting numbers.

@david, i changed this to the correct numbers though.

The setting will allow you to set any number you like, however if a collision occurs, it will increment the counter until an unused invoice number is found.

good to know.

@hillel do we have an eta when reseting serials numbers will be implemented ??

The option will be added to the UI in the next release.

@david is it supported by the backend?

Yes, reset is already baked in.

1 Like

@hillel as you are the UI expert here, what about the company logo, seems not working, and i tried to upload the same logo couple of times but just not showing u, is there a new requirements for the logo ?