Can't upload backup

I followed your link to restore the backup from CLI, but nothing was restored, it was still the same as a fresh install.

Is in the backup the “old” app.yml file and will it be overwritten when I restore the backup? If not, the whole backup is useless.

I tried to restore the backup than from within Discourse and now I have a blank site.

This is from the command line when I try to restore the backup. Of course I followed the commands from the link, but it seems that something has changed.

Starting restore: backup-2021-12-06-185610-v20211201221028.tar.gz
'system' has started the restore!
Marking restore as running...
Making sure /var/www/discourse/tmp/restores/default/2021-12-18-163225 exists...
Copying archive to tmp directory...
EXCEPTION: lib/discourse.rb:127:in `exec': Failed to copy archive to tmp directory.
cp: cannot stat '/var/www/discourse/public/backups/default/backup-2021-12-06-185610-v20211201221028.tar.gz': No such file or directory
lib/discourse.rb:154:in `execute_command'
lib/discourse.rb:127:in `exec'
lib/discourse.rb:34:in `execute_command'
/var/www/discourse/lib/backup_restore/local_backup_store.rb:42:in `download_file'
/var/www/discourse/lib/backup_restore/backup_file_handler.rb:62:in `copy_archive_to_tmp_directory'
/var/www/discourse/lib/backup_restore/backup_file_handler.rb:22:in `decompress'
/var/www/discourse/lib/backup_restore/restorer.rb:42:in `run'
script/discourse:149:in `restore'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor/base.rb:485:in `start'
script/discourse:290:in `<top (required)>'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.26/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.26/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.26/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.26/lib/bundler/cli.rb:477:in `exec'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.26/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.26/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.26/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.26/lib/bundler/cli.rb:31:in `dispatch'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.26/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.26/lib/bundler/cli.rb:25:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.26/exe/bundle:49:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.26/lib/bundler/friendly_errors.rb:128:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.26/exe/bundle:37:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Trying to rollback...
There was no need to rollback
Cleaning stuff up...
Removing tmp '/var/www/discourse/tmp/restores/default/2021-12-18-163225' directory...
Marking restore as finished...
Notifying 'system' of the end of the restore...
Restore done.
1 Like

So you put the file in the wrong place or for the filename wrong. If it’s the latter, then

   discourse restore

With no filename will suggest the files available.

If you do a

     discourse backup

You can see where it put the file. I won’t try to type the proper path on my phone.

1 Like

No, I did it like it’s written here:

So if this is the wrong path, the tutorial is wrong. That’s why I asked where to put the file.

It’s really easy to type things wrong. That’s why I suggested ways to test that you got things in the right place. Did you try

  discourse restore

With no filename?

I know what you mean. but I did it exactly according to the instructions (without making a mistake, I copied the paths), so I ask if the instructions are wrong or if something has changed in the paths in the last 2 years.

I will try it again, but maybe I have to reinstall Discourse again because now I have only a blank site.

I don’t think you can copy and paste this bit without changing it?

1 Like

I think the destination path is the right, otherwise they should say where exactly to move it.

1 Like

Ah, I see. I read your post as ‘I couldn’t have mistyped anything as I copied and pasted it all from the guide’. :slightly_smiling_face:

So I could restore the backup with discourse restore, but some categories are missing, the whole header is missing, I can’t login, the app.yml is still the same as a fresh install and many more.
The backup was from 06.12.21 and I chose to backup everything, but half of the things are missing.

So for me the whole backup and restore process is a totally mess!

This must be incredibly frustrating. You have my sympathies.

The app.yml isn’t included in the Discourse backup. You would need to copy one over from your old instance, or edit a new one.


This should be said at the time the backup is created (as an info at the end). I have no access to the old file, and creating a new one is possible, but I can’t remember which plugins I had.

But then there is still the question why some categories and topics are missing, and why the header is missing and I can’t login.

That I am not sure of. :slightly_smiling_face: Did you run ./launcher discourse-setup on your new instance?

Yes, of course. Or shouldn’t I do this to restore? Or do you mean after the restore?

I thought that may fill in some of the missing pieces, but I’m not sure.

It may be worth taking the back-up file and restoring it to a fresh discourse with an updated app.yml, and seeing if that’s any better.

1 Like

It was a fresh install on a new server, and I thought the app.yml is in the backup but I was wrong. I have no access to the “old” discourse instance so there’s no way to restore the app.yml file as it seems.

You can edit the existing app.yml to add the things you think it might be missing? I’m not sure what would stop categories or logins being copied over though?

Did you restore a full back-up file? The one in the OP stalled out at 40%. If you restored that version it may explain why half your stuff is missing?

I’m just guessing at this point though. :slightly_smiling_face: Sorry I couldn’t be more help.

Sorry you’ve have such trouble. I can’t explain how it might have happened.

I cannot imagine a way that a backup would restore only some categories. If only some categories are restored then that’s what is in the backup you took. Perhaps you have an old backup.

The app.yml doesn’t have anything to do with your data, just the hostname and other stuff required to set up Discourse. You can restore any database to any site.

1 Like

I will reinstall Discourse again (with a fresh server image) and will try to restore the backup again.

The 40% stucking was with the upload in Discourse directly, after that I copied the backup via SCP to the server.

Yes, that’s true, but I thought something important will be saved in the backup too. Now I don’t know which plugins I had installed in the old instance and how the settings were from the them.
The backup was from 6th December this year, so only a few days ago.

That is frustrating.

The good news is that the settings are in the database, so if you install the plugin it’ll get the settings.

1 Like

I just reinstalled the server and Discourse and restored the backup.
If everything else is ok I can figure out which plugins I had installed.