Moving Versiob 5.11.40 from 1 server to other server

Version ie <5.11.40>

Environment

Checklist

  • Can you replicate the issue on our v5 demo site https://demo.invoiceninja.com or Invoice Ninja? No
  • Have you searched existing issues? Yes
  • Have you inspected the logs in storage/logs/laravel.log for any errors?

Yes, I notice this error :
[2025-02-18 14:00:04] production.ERROR: The MAC is invalid. {“userId”:1,“exception”:"[object] (Illuminate\Contracts\Encryption\DecryptException(code: 0): The MAC is invalid. at /home/accountname/sub/factuur.infowebs.nl/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:189)
[stacktrace]

What I did was :

  1. Updated the excisting installation to the latest version.
  2. Installed Invoice Ninja on the new server using Softaculous App Installer (same version as exciting installation)
  3. Tested new installation (is working)
  4. Used phpmyadmin to export database from old server
  5. Used phpmyadmin to import database to new server
  6. Tested new installation. Login screen is displayed. After login error 500.

Please advise how to solve.

Hi,

That error usually means the APP_KEY value has changed, you’ll want to copy the original .env file to fix this.

Thank you. That was the solution. The APP-KEY is related to the database zo copying the old .env file to the new location (and modifying the database credentials/password/location) solved the problem. Thank.

So for those moving the installation to a new server :

  1. Updated the excisting installation to the latest version.
  2. Installed Invoice Ninja on the new server using Softaculous App Installer (same version as exciting installation)
  3. Tested new installation (is working)
  4. Used phpmyadmin to export database from old server
  5. Used phpmyadmin to import database to new server
  6. Copy the old .env file to the new installation (check database name/user/password)
1 Like