Failing Migration

Good afternoon, white-label self hoster here,

So for quite a bit of time now I’ve been trying to migrate to V5. I initially had it setup on simple cPanel hosting like my V4 is, and now I’m currently utilizing Cloudron to manage several apps including V5. My migration has failed over and over and I dug for awhile to try and find solutions to the errors. At some point I found a post talking about commenting out ‘documents’ => $this->getDocuments(), and ‘ninja_tokens’ => $this->getNinjaToken(), in StepsController.php

This did enable the migration to go through mostly I think but not correctly. I wasn’t sure as I never received an email. I wiped my V5 and ran the migration a few more times to see if I could get it to work, and near the end I did get an email saying migration failed stating: Undefined index: ninja_tokens

I’m guessing that has something to do with commenting out those two lines. When I look at the log of the partly done migration it stops at getting documents. In my V5, it seems like most of the data is there, but obviously its not complete. I tried processing an open invoice and am getting an error that no customer can be found. I’m not sure what to do.

Original errors:
(1/2) ErrorExeption - Trying to get property ‘contact_id’ of non object in GenerateMigrationResources.php line 364.
at HandleExceptions->handleError(8, ‘Trying to get property ‘contact_id’ of non-object’, /mydomain.com/app/Traits/GenerateMigrationResources.php’, 364, array(‘transformed’ => array(), ‘ninja_client’ => object(Client), ‘agts’ => object(Collection), ‘is_default’ => true, ‘agt’ => object(AccountGatewayToken), ‘payment_method’ => null))

(2/2)ErrorExeption - Undefined variable: completeService in StepsController.php in line 189
at HandleExceptions->handleError(8, ‘Undefined variable: completeService’, ‘/mydomain.com/app/Http/Controllers/Migration/StepsController.php’, 189, array(‘request’ => object(MigrationCompaniesRequest)))in StepsController.php line 189

Hi,

@david do you have any suggestions?

@tdmc,

are you on the latest version of v4 and v5?

@david Yep. Cloudron keeps me on the latest version (5.3.44 currently) and I’ve tried running the migration on both 4.5.39 and the latest version 4.5.47 and receive the same error unfortunately.

@tdmc

I have a fix in the latest master branch of v5 for this, it will be available in the next release.

@david Thanks a bunch! I ran the latest migration and it completed and sent me an email. Almost everything is good to go, though I am having just one issue. A few of the clients connections to their stripe customer profile seem to be missing. What I mean by this is, for a few people, I login to the client portal and run their cards for regular invoices occasionally, as they rather have me do that. For some of these people, their payment data is missing. I still see it in stripe, but invoice ninja is asking for new cards to be added. I have run the import and verify customer options in the settings.

Also one other random quick question, the auto bill setting in online payments section only has options for send date and due date, is this specifically for recurring invoices only? I don’t want to send a regular non-recurring invoice and then have it auto bill randomly.

@tdmc

this functionality is just for recurring invoices.

normal invoices will auto bill but on their due date.

In regards to client payment details, if the card on file is expired we can’t import these as they will not be usable, could this explain it?

@david Wait, but I don’t want normal invoices to auto bill at all, only recurring ones.

Also, the cards on file are not expired.

@tdmc,

This is a manual override on regular invoices that allow you to auto bill, the default setting for regular invoice is autobill - off.

I’m not sure why Stripe is not importing all cards. We use the client.email address to perform the matching between stripe customers and invoice ninja customers… could this explain it?

Thanks on the invoice setting information.

I don’t know why either. The clients all synced over with their emails the same. Looking at stripe the emails are the same as they should be. When I run verify customers, it says stripe 10, invoice ninja 13.

@david Is there anyway to manually fix?

@tdmc

are you missing stripe customers in Invoice Ninja? It sounds like you have more clients in Invoice Ninja now than stripe?

@david I mean I’m assuming that’s the issue being that the connection between that client and the stripe isn’t working. I’ve run the import customer function and it now says invoice ninja 14 and stripe 10. Is there somewhere the link is stored that I could just edit and manually put in the stripe customer id or something.