Using the resume-from-last-log feature with fctl ledger import

Last updated: March 18, 2025

When importing large ledgers using fctl ledger import, timeouts may occur during the import process. The --resume-from-last-log flag allows you to resume an interrupted import from where it left off, rather than starting over from the beginning.

Using the resume feature

To use this feature:

  1. Start your initial import using the standard import command:

    fctl ledger import myfile.json
  2. If the import times out or fails, retry the import with the resume flag:

    fctl ledger import myfile.json --resume-from-last-log

This feature requires fctl version 2.3.0 or later. You can check your version with fctl --version.

Important notes

  • The resume feature works only when the ledger is in its initial state. If any writes have occurred to the ledger after a partial import, you won't be able to resume the import.

  • Viewing the ledger in the console does not affect the ability to resume an import.

  • For optimal performance, large imports should be done in smaller batches to avoid timeouts.

Troubleshooting

If you encounter the error "ledger must be in initializing state to be imported" when trying to resume, this indicates that the ledger's state has changed since the initial import attempt. In this case, you'll need to create a new ledger and start the import process from the beginning.