Gateway Network Databases

Hello, I have a gateway network set up. An Ignition Edge gateway acting as a remote gateway and an Ignition gateway as the local gateway. This is based on the edge architecture described here:

I want to store the tag data history from the 1-week buffer on the edge gateway into the SQL database on the local ignition gateway.

Please advise me on the way to do this.
Thanks in advance.