Project

General

Profile

RedmineBackupRestore » History » Version 1

Go MAEDA, 2018-01-10 15:08
Made dedicated page from [[RedmineInstall#Backups]] and [[RedmineUpgrade#Step-2-Backup]]

1 1 Go MAEDA
h1. Backing up and restoring Redmine
2
3
{{>toc}}
4
5
h2. Backup
6
7
Redmine backups should include:
8
* Database
9
* Attachments (stored in the @files@ directory of your Redmine install)
10
11
h3. Backing up database
12
13
h4. MySQL
14
15
The @mysqldump@ command can be used to backup the contents of your MySQL database to a text file. For example:
16
<pre>
17
/usr/bin/mysqldump -u <username> -p<password> <redmine_database> > /path/to/backup/db/redmine.sql
18
</pre>
19
20
h4. PostgreSQL
21
22
The @pg_dump@ command can be used to backup the contents of a PostgreSQL database to a text file. Here is an example:
23
<pre>
24
/usr/bin/pg_dump -U <username> -Fc --file=redmine.sqlc <redmine_database>
25
</pre>
26
27
h4. SQLite
28
29
SQLite databases are all contained in a single file, so you can back them up by copying the file to another location.
30
31
h3. Backing up attachments
32
33
All file uploads are stored in the @files/@ directory. You can copy the contents of this directory to another location to easily back it up.
34
35
h3. Sample backup script
36
37
Here is a simple shell script that can be used for daily backups (assuming you're using a MySQL database):
38
39
<pre>
40
# Database
41
/usr/bin/mysqldump -u <username> -p<password> <redmine_database> | gzip > /path/to/backup/db/redmine_`date +%Y-%m-%d`.gz
42
43
# Attachments
44
rsync -a /path/to/redmine/files /path/to/backup/files
45
</pre>
46
47
48
h2. Restore
49
50
TODO