postgres@ubuntu:~$ ls
10 logfile openproject.sql postgresql-dump-20210121064442.pgdump
postgres@ubuntu:~$ psql openproject < openproject.sql
Restoring an OpenProject backup
Package-based installation (DEB/RPM)
Assuming you have a backup of all the OpenProject files at hand (see the Backing up guide), here is how you would restore your OpenProject installation from that backup.
As a reference, we will assume you have the following dumps on your server, located in /var/db/openproject/backup
:
Stop the processes
First, it is a good idea to stop the OpenProject instance:
Restoring assets
Go into the backup directory:
Untar the attachments to their destination:
Untar the configuration files to their destination:
Untar the repositories to their destination:
Restoring the database
Note: in this section, the <dbusername>
, <dbhost>
and <dbname>
variables that appear below have to be replaced with the values that are contained in the DATABASE_URL
setting of your installation.
First, ensure the connection details about your database is the one you want to restore
Then, to restore the PostgreSQL dump please use the pg_restore
command utility. WARNING: The command --clean --if-exists
is used and it will drop objects in the database and you will lose all changes in this database! Double-check that the database URL above is the database you want to restore to.
This is necessary since the backups of OpenProject does not clean statements to remove existing options and will lead to duplicate index errors when trying to restore to an existing database. The alternative is to drop/recreate the database manually, if you have the permissions to do so.
Restart the OpenProject processes
Finally, restart all your processes as follows:
Docker-based installation
For Docker-based installations, assuming you have a backup as per the procedure described in the Backing up guide, you simply need to restore files into the correct folders (when using the all-in-one container), or restore the docker volumes (when using the Compose file), then start OpenProject using the normal docker or docker-compose command.
Restoring a dump
Internal error An error occurred on the page you were trying to access. If you continue to experience problems please contact your OpenProject administrator for assistance. If you are the OpenProject administrator, check your log files for details about the error.
Then, simply run openproject configure
, otherwise, use RAILS_ENV=production bundle exec rails db:migrate
Tidak ada komentar:
Posting Komentar