MONEY MANAGER UPGRADE - KEEPING EXISTING DATA

1. Make a full backup of the current website folder.
2. Export the current database from phpMyAdmin.
3. Test on a copied folder/database first.
4. Import database_patch.sql into the EXISTING database once.
5. Upload the contents of this moneymanager folder over the copied installation.
6. Log in using the existing email and password.
7. Confirm these menu items appear:
   - Account Transfers
   - Loans Given / Taken
   - Complete Reports
   - Users & Permissions (administrator)
8. Verify the dashboard account and overall balances.
9. Test one income, expense, transfer, loan and Excel report before production.

VERSION 4 UPDATE

If Version 3 is already installed, import database_patch_v4.sql only, then upload
the Version 4 files. This adds income categories above the existing income
sources. It does not change existing income transactions.

DATA PRESERVATION

The patch does not drop, rename or empty user, account, category, assets, bills,
budget or totals. It only creates new tables beginning with mm_. The existing
income and expense rows remain unchanged and are included in the new balances.

BALANCE RULES

Account balance = existing income - existing expenses - transfers out
+ transfers in - loans given + loans taken + loan collections - loan repayments.
Transfers do not change the overall balance. Loan principal is kept separate
from operating income and expense in the complete report.

ADMINISTRATOR

The current user with UserId 1 is initialized as administrator by the SQL patch.
Use Users & Permissions to assign accounts, sources/categories and actions to
other existing users.
