From MT4, go to Tools -> History Center. There, open the currency you want to export (XAUUSD) and double click on 1 Minute (M1) so that it is refreshed on the right side of the screen. Then just click on the Export button and choose your destination file.

As general information, demo accounts contains limited historical data across. It's best we recommend extracting  historical data from a live account on MT4. 

Please note that tick data is typically retained for an extended duration. However,  storage considerations come into play, as tick data can occupy a substantial amount of storage space. The accessibility of tick data for frequently traded symbols on MT4 aligns with our standard tick data retention period.

Although there isn't a specific date set for the removal of tick data, we aim to store new tick data while removing older tick data that is no longer operationally significant, all while taking into account capacity constraints.

Kindly refer to the details below for an overview of the MetaTrader 4 server limitations regarding historical data:

•     65536 bars for M1 charts (equal to several months)
•     32768 bars for M5 charts (equal to about 6 months)
•     16384 bars for M15, M30, H1, H4, and D1 charts
•     1024 bars for W1 charts
•     256 bars for MN1 charts

The steps are as follows: Set 'Max bars in history' to the max > turn off auto scroll > click M1 > scroll left/'back' on the XAUUSD chart > Tools > Historic Center > Export.