# 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:** 4
**Page:** 1

<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 8, 2023, 10:35pm UTC](https://meta.discourse.org/t/make-a-backup-while-import-script-is-running/254522/1 "2023-02-08T22:35:02Z")

</div>

Hi there, I need to take a snapshot of my Discourse importer instance while the import script is still running and then restore that on a different server for testing. Would there be any problems with running the Discourse backup function while the import script is still running?

---

<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 8, 2023, 11:44pm UTC](https://meta.discourse.org/t/make-a-backup-while-import-script-is-running/254522/3 "2023-02-08T23:44:48Z")

</div>

Self-administered.  
I’m mainly concerned about the import process being corrupted or halted in some way. But I’ve got tons of RAM and processing power that’s not being fully utilized, so stress on the system isn’t a concern.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 9, 2023, 3:36am UTC](https://meta.discourse.org/t/make-a-backup-while-import-script-is-running/254522/5 "2023-02-09T03:36:17Z")

</div>

You don’t want to take a snapshot. Just stop the script and make a Discourse backup. The restart the script. It’ll pick up where it left off.

---

<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.
