# Make a backup while import script is running?

**URL:** <https://meta.discourse.org/t/make-a-backup-while-import-script-is-running/254522>\
**Category:** Migration\
**Tags:** backups\
**Created:** [February 8, 2023, 10:35pm UTC](https://meta.discourse.org/t/make-a-backup-while-import-script-is-running/254522 "2023-02-08T22:35:02Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![rahim123](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@rahim123](https://meta.discourse.org/u/rahim123)\
**Post date:** [February 9, 2023, 4:32am UTC](https://meta.discourse.org/t/make-a-backup-while-import-script-is-running/254522/6 "2023-02-09T04:32:10Z")

</div>

At the stage where it’s at now it doesn’t pick up where it left off, because it’s currently running my home-grown private message import function. I did try extensively to code it so that it would resume from the last batch number like the `import_topics` and `import_replies` functions do, but something about the algorithm in my private message function is preventing it from doing that.

I realized that Discourse had taken an automatic backup about 36 hours into the import process and apparently nothing bad happened, so I went ahead and ran another backup and exported it to another VPS and restored it there. Seems to work fine, and the importer is still going strong.

---

_[View the full topic](https://meta.discourse.org/t/make-a-backup-while-import-script-is-running/254522)._
