Restore DB problem

when I try to restore backup, created in discourse I received:

ERROR: function discourse_functions.raise_email_logs_reply_key_readonly() does not exist
ERROR: current transaction is aborted, commands ignored until end of transaction block
EXCEPTION: psql failed
/var/www/discourse/lib/backup_restore/restorer.rb:328:in `restore_dump’

I only found answer when discourse_functions.raise_email_logs_reply_key_readonly() already exist : Error when restore DB backup

Could you pleas help me?

1 Like

You might try making sure that both sites are the same version. (that’s not typically required, but that’s what I’d do next)

Version where I made backup is v.2.1.0beta6 and I try to restore on stable one(v2.2.6).

When I try to build version v2.1.0beta6 on my test environment i received an error.

Same here, I’ve just tried to run build using v.2.1.0beta6 and failed to do so

I’d try upgrading the site where you are creating the backup to v2.2.6.

Why are you on 2.1.0beta6? You should upgrade at least to the latest stable.

Stable is not really recommended, but that’s another story.

I got this version and now I have to do upgrade.

Before I start working on production, I made a backup and wanted to recreate it in a test environment.

But here are errors.

Stable is not recommended but it seems to be the only one that works and builds 2.2.6 without any issues, leaving app.yml config on default version (test-passed) is trying to install latest beta that gives me this:

var/www/discourse/lib/final_destination.rb:406:in safe_session' /var/www/discourse/lib/final_destination.rb:357:in safe_get’
/var/www/discourse/lib/final_destination.rb:129:in get' /var/www/discourse/lib/file_helper.rb:47:in download’
/var/www/discourse/lib/discourse_ip_info.rb:30:in mmdb_download' /var/www/discourse/lib/tasks/assets.rake:218:in block (3 levels) in <top (required)>’
/var/www/discourse/lib/tasks/assets.rake:217:in each' /var/www/discourse/lib/tasks/assets.rake:217:in block (2 levels) in <top (required)>’
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
I, [2019-06-17T12:32:42.665058 #14] INFO – : Downloading MaxMindDB…
Compressing Javascript and Generating Source Maps

I, [2019-06-17T12:32:42.665389 #14] INFO – : Terminating async processes
I, [2019-06-17T12:32:42.665562 #14] INFO – : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main pid: 83
I, [2019-06-17T12:32:42.665614 #14] INFO – : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 199
2019-06-17 12:32:42.665 UTC [83] LOG: received fast shutdown request
199:signal-handler (1560774762) Received SIGTERM scheduling shutdown…
2019-06-17 12:32:42.671 UTC [83] LOG: aborting any active transactions
2019-06-17 12:32:42.673 UTC [83] LOG: worker process: logical replication launcher (PID 92) exited with exit code 1
2019-06-17 12:32:42.675 UTC [87] LOG: shutting down
199:M 17 Jun 2019 12:32:42.747 # User requested shutdown…
199:M 17 Jun 2019 12:32:42.747 * Saving the final RDB snapshot before exiting.
199:M 17 Jun 2019 12:32:42.757 * DB saved on disk
199:M 17 Jun 2019 12:32:42.757 # Redis is now ready to exit, bye bye…
2019-06-17 12:32:42.877 UTC [83] LOG: database system is shut down


Pups::ExecError: cd /var/www/discourse && su discourse -c ‘bundle exec rake assets:precompile’ failed with return #<Process::Status: pid 1500 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn’
exec failed with the params {“cd”=>"$home", “hook”=>“assets_precompile”, “cmd”=>[“su discourse -c ‘bundle exec rake assets:precompile’”]}
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

This is out of the box installation process. No add-ons, no changes. Any ideas?