# Replay old log file to hdb

**URL:** <https://forum.kx.com/t/replay-old-log-file-to-hdb/10094>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [July 10, 2015, 2:47am UTC](https://forum.kx.com/t/replay-old-log-file-to-hdb/10094 "2015-07-10T02:47:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshmyzie2](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@joshmyzie2](https://forum.kx.com/u/joshmyzie2)\
**Post date:** [July 10, 2015, 2:47am UTC](https://forum.kx.com/t/replay-old-log-file-to-hdb/10094/1 "2015-07-10T02:47:00Z")

</div>

Hi,Say I have a standard kdb+/tick setup and for whatever reason mytickerplant and rdb are shut down before the end of the day and broughtback up after the new day has started.So, I will have a sym2015.07.09 file, but because it is now 2015.07.10and I missed the end-of-day hdb write, my 2015.07.09 data will never getwritten to the hdb.What’s the recommended way to load the log file and save all of thetables to the hdb?Thanks,Josh

---

<div class="post-metadata">

**Author:** ![pressjonny0](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@pressjonny0](https://forum.kx.com/u/pressjonny0)\
**Post date:** [July 10, 2015, 9:22am UTC](https://forum.kx.com/t/replay-old-log-file-to-hdb/10094/2 "2015-07-10T09:22:00Z")

</div>

Hi Josh

The usual way of doing it is to use -11! to replay the log file. &nbsp;A basic script would be something like&nbsp;

// load schema

\l schema.q

// define upd

upd:insert

// replay log file&nbsp;

-11!`:schema2015.07.09

// save

.Q.hdpf[`::;`:hdb;2015.07.09;`sym]

This will read the full log file into memory. &nbsp;So you will need to have RAM available.&nbsp;

TorQ has a TP log replay script:&nbsp;

https://github.com/AquaQAnalytics/TorQ/blob/master/code/processes/tickerlogreplay.q

which allows a bit more flexibility. &nbsp;For example, you can replay the tp log file in chunks (so less memory usage), ignore certain tables, replay messages in a range, replay batches of log files etc.&nbsp;

Thanks&nbsp;

Jonny

>
