Migrate v4.5.50 to v5.5.49-C103 / Error Trying to get property

Latest v4 (to my knowledge) fully functional, I installed the latest v5 (v5.5.49-C103 as of this moment) on a new subdomain and set it up functional.

Now when I start migration from the v4, it detects the Company but when clicking Migrate (also using the force option) I get:

Trying to get property ‘account_gateway_id’ of non-object

The migration stops there, in the new installation no sign of the Company, what can be wrong?

Hi,

@david do you have any ideas?

Just to add:

I can only find (in the v4 installation database) any reference to account_gateway_id in the account_gateways table showing: -See screenshot-

Have you manually modified the v4 database? It sounds like a row may have been deleted?

Never touched it manually, did use the update scripts for v4 in the past?

FYI: I restored the oldest backup on file (from 2018) on a test server, migration also fails with same error.

Any help would be realy apreciated. Setup v5 again from 0, all working fine. Try’d another migration, same error:

Included log this time:

Welkom bij de nieuwe versie van Invoice Ninja

Trying to get property ‘account_gateway_id’ of non-object

Factuur gemaakt via Invoice Ninja - v4.5.50 | White labeled

Messages54TimelineExceptionsViews25RouteQueries93Models135MailsSessionRequest

7.4.33793ms19MBPOST migration/companies

  • INFOLOG[07:54:32] LOG.info: get account
  • INFOLOG[07:54:32] LOG.info: get company
  • INFOLOG[07:54:32] LOG.info: get co settings
  • INFOLOG[07:54:32] LOG.info: get users 2
  • INFOLOG[07:54:32] LOG.info: get tax rates => 0
  • INFOLOG[07:54:32] LOG.info: get payment terms => 8
  • INFOLOG[07:54:32] LOG.info: get clients => 32
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: Importing contacts => 1
  • INFOLOG[07:54:32] LOG.info: get get company gateways => 4
  • INFOLOG[07:54:32] LOG.info: translating gateway ID = 17
  • INFOLOG[07:54:32] LOG.info: translating gateway ID = 17
  • INFOLOG[07:54:32] LOG.info: get transform fees and limits
  • INFOLOG[07:54:32] LOG.info: translating gateway ID = 61
  • INFOLOG[07:54:32] LOG.info: translating gateway ID = 61
  • INFOLOG[07:54:32] LOG.info: get transform fees and limits
  • INFOLOG[07:54:32] LOG.info: translating gateway ID = 23
  • INFOLOG[07:54:32] LOG.info: translating gateway ID = 23
  • INFOLOG[07:54:32] LOG.info: get transform fees and limits
  • INFOLOG[07:54:32] LOG.info: translating gateway ID = 17
  • INFOLOG[07:54:32] LOG.info: translating gateway ID = 17
  • INFOLOG[07:54:32] LOG.info: get transform fees and limits
  • INFOLOG[07:54:32] LOG.info: get client gateway tokens => 8
  • INFOLOG[07:54:32] LOG.info: Trying to get property ‘account_gateway_id’ of non-object

No data shown in V5

In your AccountGatewayToken table in your v4 database,

there will be a column

account_gateway_id with an integer that does not exist in the AccountGateway table.

You’ll need to find this and remove the reference.

Actually, this are both tables from the live v4 SQL (account_gateways and account_gateway_tokens)


Can you tell me what record is wrong?

PS: I am okay with migrating without the payment providers, I can add then manually again in v5 later…

PS2: Also already try’d backing up the v4 sql and removing all content from both tables above, still migration fails.

Apreciate the help!

Kind regards,

ONSEA Jellis

Bump… Anyone can see what is wrong and how to correct it?

The original database on the v4 is obviously restored and I have no way of migrating and cannot find anything wrong/missing inside the database. It was -to my knowledge- never been edit manually besides for testing latest days (always creating a backup and restoring the backup aftrewards).

Do you have any more ideas by any chance?

@david do you have any suggestions?

@accessweb

If you don’t mind testing. Take a backup of your v4 database, and then truncate the payment_methods table and then reattempt the migration.

this will not transfer the gateway tokens during the migration.

Hello! Thank you! Finally getting there…

Migration has started. We’ll update you with status, on your company e-mail.
→ All data, company inc. logo etc is now visible on v5, all seems working at first glance!

I guess I need to replace the SQL backup again on the v4 because this is still the live version? Once I am done testing and setting everything up and forward the v4 to v5 in the end (I will do the migration then again on a new v5 install without the payment_methods records I guess?) what do I need to fix in the v5 after that? Or do you have any other solution when all data can be kept and this was just for testing purposes?

Thanks for finally getting somewehere, scratching my head for over a week on this!

I’m not sure why the migration is falling over for you at that point. this is the first time i’ve seen this particular issue. If it isn’t super critical to bring over the payment tokens, just leave them out. Otherwise you would need to manual build the tokens back in v5.

For me it’s not critical at all because we barely receive online payments (as you can see in the screenshots also) so clients needing to re-apply some information is not a big deal at all for me. I’ve been a invoice ninja user from the very beginning (when white label was still 15$ or something), the database has undergone alot of updates and migrations in over 5 years; guess starting from early v3 or something like that what might contribute to this error.

I would gladly provide the small SQL dump somewehere for you to test on it if it can help others with alot more online payments when this might be a real issue. For me I marked your answer as solved/the solution but I do believe I am not the only one facing/going to face this problem. I realy have no recollection ever manipulating the database by hand so there must be something…

Let me know if I can provide anything that can help also understanding the why on this issue!

@accessweb

If you installation is from v3, it is quite possible there is a legacy issue that we haven’t seen before.

I think for now we can mark the issue as resolved, if we see the issue again we can look deeper.