Kafi — A clearer record of your portfolioالعربيةOpen your portfolio

How to import and export your portfolio with CSV

A CSV file is a portable table that can help you back up records or move them between tools. It is also easy to misread: columns, dates, currencies, and decimal conventions differ between brokers. A deliberate export and a small test import are safer than assuming every spreadsheet is interchangeable.

Export a backup before changing anything

Start by exporting the current portfolio from the app and keeping a dated copy in a secure location you control. Do not edit your only backup. Make a second copy for cleanup or transfer, then open it in a spreadsheet or text editor and confirm that rows and columns are present. Portfolio records in Kafi are stored in the browser, so clearing browser data can remove local information. Regular CSV exports provide a practical recovery copy and make it easier to move records to another device.

A CSV file may contain sensitive financial information even when it contains no account password. Store it thoughtfully, avoid public shared folders, and remove it from temporary devices when you are finished. Never send credentials or broker login details in a CSV. If you encrypt or protect backups, keep the recovery method separate from the file so losing one does not make the other unusable.

Understand the source file first

Broker downloads commonly include headers such as symbol, description, quantity, average price, transaction date, currency, and action. Read the broker's export notes and identify whether a row describes a current holding, a historical transaction, cash, or income. These are different record types. A portfolio snapshot cannot reconstruct a complete trade history, and a transaction file may include closed positions that should not be treated as current holdings. Decide which outcome you want before importing.

Check the file's delimiter and encoding. Commas inside company names may be enclosed in quotes; Arabic text may be saved in UTF-8; and some regional spreadsheet settings use semicolons as separators. Dates such as 04/05/2026 are ambiguous without knowing the file's convention. Decimal commas and thousands separators can also turn a quantity into the wrong value. If a row looks unclear, inspect the original text rather than accepting a spreadsheet's automatic formatting.

Map columns deliberately

Match the source columns to the import fields one by one. Confirm the identity field, asset type, quantity, price or cost basis, date, currency, and transaction direction if available. A broker's “value” may mean market value, trade value, or cash amount; do not map it to purchase cost until you know what it represents. Symbols can be market-specific, so preserve the exchange suffix when needed. For gold, retain unit and purity. For cash, check that the currency is explicit. For dividends, confirm whether the amount is gross or net.

Remove empty rows and repeated headers, but keep a clean copy of the untouched export. Do not delete rows simply because the importer flags them; first determine whether they represent a valid asset type, a closed transaction, or a malformed entry. Correct dates and decimal separators using a consistent method, and keep a note of transformations in case you need to repeat the process.

Test, import, and reconcile

When possible, try a small, representative file first: one equity, one cash entry, and one transaction are more informative than hundreds of rows. Review any preview or validation report before confirming. After import, compare the row count, total quantities, currencies, and a few individual records against the source. Look for duplicates if the same file was imported before. Never assume that a successful upload means every row was understood correctly.

If a record is missing, determine whether the file omitted it, the mapping excluded it, or the import rejected it. Keep the error output and fix the source copy rather than changing the only original. If the portfolio now contains duplicate or incorrect data, stop and compare against the backup before making bulk edits. For transaction imports, check that buys, sells, fees, dividends, and transfers have not been collapsed into a single generic row.

Verify a transfer to another device

Export again after confirming the imported portfolio, then store that verified backup with a clear date and version label. On a new device, import the file and compare selected holdings and history. Check Arabic names, symbols, fractional quantities, and date order in particular. Keep one untouched archive in addition to the working copy; that gives you a known-good point to return to if later edits or imports go wrong.

CSV is a useful bridge, not a universal financial-data standard. Broker formats change, so review every transfer and keep a record of what the file represents. The safest routine is simple: export first, inspect the source, map fields consciously, test a few rows, reconcile totals, and retain a verified backup.