# 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:** 1\
**Showing post:** 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!

```

---

_[View the full topic](https://meta.discourse.org/t/failed-when-using-backups-to-restore/248913)._
