# Failed when using backups to restore

**URL:** https://meta.discourse.org/t/failed-when-using-backups-to-restore/248913
**Category:** Support
**Tags:** backups
**Created:** [December 14, 2022, 1:59pm UTC](https://meta.discourse.org/t/failed-when-using-backups-to-restore/248913 "2022-12-14T13:59:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mikeguo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikeguo/32/278830_2.png) [@mikeguo](https://meta.discourse.org/u/mikeguo)
#### Post date: [December 14, 2022, 1:59pm UTC](https://meta.discourse.org/t/failed-when-using-backups-to-restore/248913/1 "2022-12-14T13:59:16Z")

</div>

To avoid loss of data, before importing data completely by script, I make production instance backup, download it to local, and try to restore it in local temporary instance, however failed.

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/a/0/3a095627ee9eb5a17863f624d6a9fdc4ac4211da.png)

And logs as below

```plaintext
[2022-12-14 21:58:40] 'm11' has started the restore!
[2022-12-14 21:58:40] Marking restore as running...
[2022-12-14 21:58:40] Making sure /Users/mike/otherprojects/discourse/tmp/restores/default/2022-12-14-135840 exists...
[2022-12-14 21:58:40] Copying archive to tmp directory...
[2022-12-14 21:58:40] Unzipping archive, this may take a while...
[2022-12-14 21:58:40] Extracting dump file...
[2022-12-14 21:58:40] Validating metadata...
[2022-12-14 21:58:40] Current version: 20221205225450
[2022-12-14 21:58:40] Restored version: 20221212234948
[2022-12-14 21:58:40] EXCEPTION: You're trying to restore a more recent version of the schema. You should migrate first!
[2022-12-14 21:58:40] /Users/mike/otherprojects/discourse/lib/backup_restore/meta_data_handler.rb:31:in `validate'
/Users/mike/otherprojects/discourse/lib/backup_restore/restorer.rb:112:in `validate_backup_metadata'
/Users/mike/otherprojects/discourse/lib/backup_restore/restorer.rb:43:in `run'
/Users/mike/otherprojects/discourse/script/spawn_backup_restore.rb:23:in `restore'
/Users/mike/otherprojects/discourse/script/spawn_backup_restore.rb:36:in `block in <main>'
/Users/mike/otherprojects/discourse/script/spawn_backup_restore.rb:4:in `fork'
/Users/mike/otherprojects/discourse/script/spawn_backup_restore.rb:4:in `<main>'
[2022-12-14 21:58:40] Trying to rollback...
[2022-12-14 21:58:40] There was no need to rollback
[2022-12-14 21:58:40] Cleaning stuff up...
[2022-12-14 21:58:40] Removing tmp '/Users/mike/otherprojects/discourse/tmp/restores/default/2022-12-14-135840' directory...
[2022-12-14 21:58:40] Marking restore as finished...
[2022-12-14 21:58:40] Notifying 'm11' of the end of the restore...
[2022-12-14 21:58:42] Finished!

```

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [December 14, 2022, 2:05pm UTC](https://meta.discourse.org/t/failed-when-using-backups-to-restore/248913/2 "2022-12-14T14:05:32Z")

</div>

> [@mikeguo](#):
>
> ```plaintext
> [2022-12-14 21:58:40] Current version: 20221205225450
> [2022-12-14 21:58:40] Restored version: 20221212234948
> [2022-12-14 21:58:40] EXCEPTION: You're trying to restore a more recent version of the schema. You should migrate first!
> 
> ```

You need to update the instance you’re restoring the back-up to to the latest version before doing the restore. 👍

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [January 13, 2023, 2:06pm UTC](https://meta.discourse.org/t/failed-when-using-backups-to-restore/248913/3 "2023-01-13T14:06:29Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
