File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -458,6 +458,28 @@ Example::
458
458
scheduler.add_listener(my_listener, EVENT_JOB_EXECUTED | EVENT_JOB_ERROR)
459
459
460
460
461
+ Exporting and importing jobs
462
+ ----------------------------
463
+
464
+ If you need to migrate your jobs to a different job store, you need to first export the
465
+ jobs to a JSON document and then import them back again.
466
+
467
+ Here's an example for exporting the jobs from all the scheduler's job stores::
468
+
469
+ # The scheduler has to be initialized, but can be paused
470
+ scheduler.export_jobs("/tmp/jobs.json")
471
+
472
+ Then you will import the jobs in the destination scheduler::
473
+
474
+ # Again, the scheduler needs to be either running or paused
475
+ scheduler.import_jobs("/tmp/jobs.json")
476
+
477
+ Both methods take a ``jobstore `` argument which can limit the source job store (on
478
+ export), or specify a non-default target job store (on import). The first argument for
479
+ both methods can either be an open file, a :class: `~pathlib.Path ` or a file system path
480
+ as a string.
481
+
482
+
461
483
.. _troubleshooting :
462
484
463
485
Troubleshooting
You can’t perform that action at this time.
0 commit comments