一、redmine的完整备份与恢复

1. 备份

Bitnami的Redmine本身就是自包含的,可以很简单地进行全备份。

操作如下:

进入备份数据要存放的目录

$ cd /your/folder

停掉所有服务

$ sudo /opt/bitnami/ctlscript.sh stop

创建备份文件

$ sudo tar -pczvf application-backup.tar.gz /opt/bitnami

重启所有服务

$ sudo /opt/bitnami/ctlscript.sh start

将备份文件application-backup.tar.gz存放到安全的地方。

2.恢复

Bitnami的redmine是自包含的,只需解压备份文件即可,

操作如下:

进入备份数据存放的目录

$ cd /your/folder

停止所有服务

$ sudo /opt/bitnami/ctlscript.sh stop

重命名原目录并存储

$ sudo mv /opt/bitnami /opt/bitnamiBackup

解压备份文件到原目录

$ sudo tar -pxzvf application-backup.tar.gz -C /

启动所有服务

$ sudo /opt/bitnami/ctlscript.sh start

IMPORTANT:

When restoring, remember to maintain the original permissions for the files and folders.

For example, if you originally installed the stack as 'root',

make sure that the restored files are owned by 'root'.

如果只想备份数据库,则可以用下面的操作。

二、数据库备份与恢复

1. 数据库备份

如果只想备份数据库的数据,则可以使用 "mysqldump"工具来创建数据库的备份文件

$ mysqldump -u root -p database_name > backup.sql

这个操作依赖于数据的大小,可能要耗费些时间。

database_name: 是你想备份的数据库。

例如,如果你想备份WordPress数据库,那么数据库的名字就是"bitnami_wordpress".

2. 数据库恢复

如果有数据库备份文件,就可以做恢复了。

$ mysql -u root -p database_name < backup.sql

If you want to restore the database and the database schema does not exist,

it is necessary to first follow the steps described below.

As a side note, you can find the value for BITNAMI_USER_PASSWORD

below in the application configuration file.

This depends on the application and you can find this information in the application page itself.

$ mysql -u root -p

mysql> create database database_name;

mysql> grant all privileges on database_name.* to 'bitnami'@'localhost'

identified by 'BITNAMI_USER_PASSWORD';

mysql> flush privileges;

mysql> exit;

$ mysql -u root -p database_name < backup.sql

NOTE :

the steps previously described will only back up the state of your database.

Other files that you should take into account when performing a backup are files

that have been uploaded to theapplication.

These files are stored in the application folder itslef

so you can copy this folder to have a backup of your uploaded files.

三、Redmine升级

It is strongly recommended that you create a backup before starting the update process.

If you have important data, it is advisable that you create and try to restore a backup

to ensure that everything works properly. You can get more info about

how to create a full backup here.

Of course, before executing any command, you have to start the

bitnami_console script or the shortcut on Windows before typing the following commands.

There are two different ways to upgrade your application.

If you want to upgrade the application and all Stack components PHP, Ruby, MySQL, Apache…

You can follow the steps described at How to upgrade the full Stack migrating the data?

In case you only want to upgrade the application code without modifying any other Stack components.

You can find below the steps to upgrade only the Redmine application.

In the Redmine case, these are the steps to migrate the database from an old version to a new one.

You can launch a new Redmine version instance or

download the latest Redmine installer from http://bitnami.com/stack/redmine.

Note this guide uses "/opt/bitnami" as the default installation directory,

you can use a different one if you have installed it in a different folder.

Copy the database backup to the new Bitnami version server.

Stop all servers and start only MySQL. Note that the installation directory could be different.

This is the default installation directory for Virtual Machines and Cloud images.

$ sudo /opt/bitnami/ctlscript.sh stop

$ sudo /opt/bitnami/ctlscript.sh start mysql

Remove the previous database and create the new one.

You can configure the database user password with a secure password.

$ mysql -u root -p

Password: ****

mysql> drop database bitnami_redmine;

mysql> create database bitnami_redmine;

mysql> grant all privileges on bitnami_redmine.* to 'bn_redmine'@'localhost' identified by 'DATABASE_PASSWORD';

Restore the new database:

$ mysql -u root -p bitnami_redmine < backup.sql

Edit the Redmine configuration file to update the database user password

(the same that you set previously) "/opt/bitnami/apps/redmine/htdocs/config/database.yml"

production:

adapter: mysql2

database: bitnami_redmine

host: localhost

username: bn_redmine

password: "DATABASE_PASSWORD"

encoding: utf8

Migrate the database to the latest version:

$ cd /opt/bitnami/apps/redmine/htdocs

$ ruby bin/rake db:migrate RAILS_ENV=production

Troubleshooting:

If you see the following error, go to your database

and remove the specified table and run the migrate command again.

Mysql::Error: Table 'changeset_parents' already exists:

CREATE TABLE `changeset_parents` (`changeset_id` int(11) NOT NULL, `parent_id` int(11) NOT NULL) ENGINE=InnoDB

$ mysql -u root -p

mysql> use bitnami_redmine;

mysql> drop table changeset_parents;

Copy the ""/opt/bitnami/apps/redmine/htdocs/files" folder from the old installation to the new one.

If you have installed plugins in the previous version, copy the folders

from "vendor/plugins" directory into new installation directory, in "plugins" folder.

Check the plugins also support this new version and run the following command

$ ruby bin/rake redmine:plugins RAILS_ENV="production"

Finally you should clean the cache and the sessions:

$ ruby bin/rake tmp:cache:clear

$ ruby bin/rake tmp:sessions:clear

Restart the servers and you can access to your new Redmine.

$ sudo /opt/bitnami/ctlscript.sh restart

Troubleshooting:

If you upgrade it from a 1.x version and you see something similar to this error creating an issue:

MysqlStatement::Error Value for field `value` cannot be NULL INSERT INTO custom_value ...

Go to your custom values in the admin panel,

try to edit and save them again. That should fix the issue.

阅读(10621) | 评论(0) | 转发(0) |

redmine备份_redmine数据备份,迁移与恢复相关推荐

  1. GoodSync 数据自动同步备份工具VS傲梅轻松备份系统数据备份工具 哪款更好?

    备份和同步软件的使用越来越广泛,因为在这个数据驱动的时代,数据的备份和恢复非常重要.在这里我想向大家推荐两款备份和同步软件--GoodSync和傲梅轻松备份. GoodSync是一款备份和同步软件,它 ...

  2. redmine备份_Redmine数据库备份及搬家

    Bitnami Redmine的备份分2种方式: 1.导出数据库 2.整个目录搬家 不管是哪种都想停掉服务,redmine相关的服务有以下5个: redmineApache redmineMySQL ...

  3. 爱数oracle备份软件,爱数备份软件下载 爱数备份卫士 数据备份软件

    这款爱数备份软件是一款功能丰富的数据备份软件,又叫爱数备份卫士,内置强大的备份引擎源自于爱数多年的不懈努力,可帮助用户轻松完成日常工作文档.图片.邮件等资料的备份,爱数备份卫士为用户提供领先的备份.容 ...

  4. 電腦android备份软件,数据备份软件哪个好 电脑/手机数据备份软件推荐

    硬件有价,坏了可以重买,但数据可是无价的.不管是电脑硬盘还是手机上的数据都可以通过数据备份软件进行及时的备份,下面 小编就给大家推荐几款电脑和安卓手机使用的精品数据备份软件,而且都是免费的. 数据备份 ...

  5. mysql数据库的冷热备份_MySQL数据备份方式,及热备与冷备的优缺点

    一.按照数据库的运行状态分类: (1) 热备:在数据库运行时,直接进行备份,对运行的数据库没有影响 (2) 冷备:在数据库停止运行的时候进行备份,这种备份方式最为简单,只需要拷贝数据库物理文件即可. ...

  6. mysql 的数据备份_MySQL 数据备份与还原

    一.数据备份 1.使用mysqldump命令备份 mysqldump命令将数据库中的数据备份成一个文本文件.表的结构和表中的数据将存储在生成的文本文件中. mysqldump命令的工作原理很简单.它先 ...

  7. redmine备份_Redmine 数据迁移记录

    下午将 Redmine 迁移到另一台主机,记录一下 Redmine 数据库数据迁移 先说一下备份还原 mysql 数据库的命令 备份 mysqldump -hhostname -uusername - ...

  8. postgresql导入mysql的备份_PostgreSQL数据备份、导入转

    一.pg_dump的用法: 数据库的导入导出是最常用的功能之一,每种数据库都提供有这方面的工具,例如Oracle的exp/imp,Informix的dbexp/dbimp,MySQL的mysqldum ...

  9. mysql cronjob 备份_mysql 数据备份 crontab

    每天凌晨 2 点备份数据 crontab -e 0 2 * * * mysqldump ${mysqldir}/bin/mysqldump  -h$host -P$port -uadmin -p&qu ...

最新文章

  1. 第5章 图像分类的数据集
  2. 精益数据分析(学习笔记)——长期更新
  3. 我犯的错误--关于主键
  4. Dynagen0.11+Pemuwrapper入手麻烦二三事——告诉初学者直路
  5. CodeForces 516E Drazil and His Happy Friends(数学+最短路)
  6. c#中一般处理程序中使用session
  7. 第二章-信源与信息熵(一)
  8. Matlab绘图方法整理(超完整版)
  9. 尝试修改smali码破解App
  10. 《opencv学习笔记》-- 感兴趣区域(ROI)、图像混合
  11. 如何获取 iOS 设备 UDID?
  12. python基础之语句_python基础之条件语句
  13. 爱荷华州立 计算机博士,2020年爱荷华州立大学博士专业设置
  14. 安装Office Visio 提示Office 16 Click-to-Run Extensibility Component
  15. linux怎么查看系统环境变量路径,Linux系统中的环境变量该如何设置与查看
  16. _variant_t数据类型
  17. [C语言]Pow函数的实现
  18. 互联网应用开发实践:需求分析与数据库设计
  19. ! LaTeX Error: File xxx.sty not found-统一解决办法
  20. 流氓并不可怕,就怕流氓有文化 -- 这是一个知识改变命运的例子

热门文章

  1. 攻略丨一文速览2018世界机器人大会最全参会指南
  2. 葫芦侠三楼html源码,葫芦侠3楼论坛
  3. mysql-front 1251_mysql执行错误#1251 (mysql-front连接)解决方案
  4. 小白学小程序需要的JavaScript知识点
  5. 如何查看python库介绍,以及该库下的函数
  6. Coot 简单操作图文详解
  7. 5个简单步骤掌握TensorFlow中的Tensor
  8. 打包后的apk微信分享依然失败
  9. 爬虫用的wkhtmltopdf windows安装测试——Html转pdf工具
  10. 西门子PLC1200自由口通信