How backup/clone wiki pages

Added by filippo mandelli 5 months ago

Hello,
I would like to share wiki pages cloning this information to another instance of redmine.
How can I do that?
I suppose I just have to do a query to backup wiki and copy to the other instance.
Thanks to who can help me.

Replies (4)

RE: How backup/clone wiki pages - Added by Martin Denizet (redmine.org team member) 5 months ago

Hello Filippo,

I think I'd try to use as_json / from_json.
And do something like:

WikiPage.all.each do |w|
   File.write("wikipage-{w.id}.json", w.as_json)
end

And then load the files on the target instance with from_json. Documentation here

Pseudo code, not tested! A condition is maybe needed, I can't recall from memory

Cheers,

RE: How backup/clone wiki pages - Added by filippo mandelli 4 months ago

Hello Martin,
I'm trying dump like this:

mysqldump -u root -p redmine projects attachments wikis wiki_contents wiki_content_versions wiki_pages wiki_redirects attachments news > dump.sql

And save in local redmine installation (in future it will be open to my colleagues):
mysql redmineLocal < backup-file.sql

Testing using local(windows OS) redmine installation, but how can I run rails upgrade command like:

c:\Bitnami\redmine-3.4.5-1\apps\redmine\htdocs\vendor\bundle\ruby\2.3.0\bin>RAIL
S_ENV=production bundle exec rake redmine:plugins:migrate
"RAILS_ENV" non è riconosciuto come comando interno o esterno,
un programma eseguibile o un file batch.

Cheers, Filippo

RE: How backup/clone wiki pages - Added by filippo mandelli 4 months ago

I tested a nice solution:

Save dump file:
mysqldump -u root -p redmine projects attachments wikis wiki_contents wiki_content_versions wiki_pages wiki_redirects news enabled_modules > dump.sql

Restore dump:
mysql redmine < backup-file.sql

Attached files are saved in:
Attached files are saved in folder/subfolder (copy only image files it is save): /opt/redmine/files/
(Only images (.jpg/.png/.bmp) have to be copied)

RE: How backup/clone wiki pages - Added by filippo mandelli 4 months ago

filippo mandelli wrote:

Hello Martin,
I'm trying dump like this:

mysqldump -u root -p redmine projects attachments wikis wiki_contents wiki_content_versions wiki_pages wiki_redirects attachments news > dump.sql

And save in local redmine installation (in future it will be open to my colleagues):
mysql redmineLocal < backup-file.sql

Testing using local(windows OS) redmine installation, but how can I run rails upgrade command like:

c:\Bitnami\redmine-3.4.5-1\apps\redmine\htdocs\vendor\bundle\ruby\2.3.0\bin>RAIL
S_ENV=production bundle exec rake redmine:plugins:migrate
"RAILS_ENV" non è riconosciuto come comando interno o esterno,
un programma eseguibile o un file batch.

Cheers, Filippo

I moved my test to linux

(1-4/4)