Skip to content

Commit

Permalink
Added user's guide section for export/import
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Nov 24, 2024
1 parent 50f67c8 commit fcec69c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/userguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,28 @@ Example::
scheduler.add_listener(my_listener, EVENT_JOB_EXECUTED | EVENT_JOB_ERROR)


Exporting and importing jobs
----------------------------

If you need to migrate your jobs to a different job store, you need to first export the
jobs to a JSON document and then import them back again.

Here's an example for exporting the jobs from all the scheduler's job stores::

# The scheduler has to be initialized, but can be paused
scheduler.export_jobs("/tmp/jobs.json")

Then you will import the jobs in the destination scheduler::

# Again, the scheduler needs to be either running or paused
scheduler.import_jobs("/tmp/jobs.json")

Both methods take a ``jobstore`` argument which can limit the source job store (on
export), or specify a non-default target job store (on import). The first argument for
both methods can either be an open file, a :class:`~pathlib.Path` or a file system path
as a string.


.. _troubleshooting:

Troubleshooting
Expand Down

0 comments on commit fcec69c

Please sign in to comment.