Project

General

Profile

Actions

How to Restore Redmine Production Database on Ubuntu

I you need to upload a Backup, Filebrowser is an easy way to do this.

It's important to note that the specific commands may vary depending on your setup and configuration, so it's always a good idea to double-check the details before running any commands. Overall, these instructions should help users successfully restore a Redmine backup and get their instance up and running again.

Log in to your server as a user with sudo privileges.

Open a terminal window.

Navigate to the directory where you stored the backup file.

cd /root/backups

Use the following command to restore the Redmine production database:

mysql -u <username> -p<password> -h <hostname> <redmine_database> < redmine_production_backup.sql

In our case, the command will be:

mysql -u redmine -p<mypasword> -h localhost redmine_production < redmine_production_backup.sql
 or this 
mysql -u root -p<mypasword> -h localhost redminedb < redmine_production_backup.sql

Once the database has been restored, you can copy the files back to the Redmine files directory using the following command:

sudo rsync -a /root/backups/redmine_files /var/www/redmine/files

or 

sudo rsync -a files /opt/redmine/files

After copying the files, make sure to set the correct ownership and permissions:

sudo chown -R www-data:www-data /var/www/redmine/files
sudo chmod -R 755 /var/www/redmine/files

or

sudo chown -R www-data:www-data /opt/redmine/files
sudo chmod -R 755 /opt/redmine/files

Updated by Gareth Eaton over 1 year ago · 10 revisions