Skip to content
Snippets Groups Projects
Commit 47fb6dd3 authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

updated POD sections

parent 0d61a777
No related branches found
No related tags found
No related merge requests found
@*
ts.*
typescript
tmp/
......@@ -3,17 +3,17 @@ Perl script to sync individual projects to another Redmine instance.
Status
My current goal is to synchronize one isolated project, which only has
Wiki pages and attachments, from one instance to another. In the end,
this project shall only be used on the destination instance. This is
more complicated that initially assumed but still leaves out the rather
hairy problem of migrating issues or even issue numbers and whatever
embedded in Wiki text.
My current goal is to synchronize one isolated project, which only
has Wiki pages and attachments, from one Redmine instance to another.
In the end, this project shall only be used on the destination instance.
This is more complicated than initially assumed, but still leaves out
the rather hairy problem of migrating issues or even issue numbers and
whatever embedded in Wiki text.
Right now, synchronizing stuff that are related to users work.
Wiki migration seems to work now too.
The next step is are Wiki-Attachments.
The next step: Wiki-Attachments
Why Perl? I'm not fluent enough in Ruby to even consider it as the
tool of choice for this problem. The script directly talks with
......@@ -26,3 +26,9 @@ NOTES
The project's entry in 'wikis' whould be added to syncs by hand
since Redmine creates the Wiki but the script currently doesn't
check for that, it only looks at the syncs table.
TODOS
* watchers: point to various content types, so only stuff
that is actually handled should be migrated here
......@@ -9,7 +9,10 @@ use warnings;
=head1 DESCRIPTION
do stuff on a Redmine database
Do stuff on a Redmine database. Used as an experimental sync-tool to
migrate individual projects to another server.
See https://github.com/gonter/redmine-sync
=head1 OPERATION MODES
......@@ -31,10 +34,23 @@ use Redmine::DB::MySQL;
use Redmine::DB::CTX;
# use Redmine::DB::Project; nothing here yet ...
# yeah, this should be in a config file, but
my $setup_file;
# --- BEGIN ------------------------------------------------------------
=begin comment
Yeah, this should be in a config file, but this will do for now.
This structure ($setup) resembles something like a "synchronisation
context". A "synchronisation context" needs to describe:
* src: source Redmine instance
* dst: destination Redmine instance
* projects to be synced
# this structure ($setup) resembles something like a "context"
=end comment
=cut
my $setup_file;
my $setup=
{
'src' =>
......@@ -48,10 +64,10 @@ my $setup=
'db' => 'production',
},
'sync_context_id' => 1,
'syncs' =>
'syncs' => # not used, instead, this is written directly into the database
[
# { 'table' => 'projects', 'src_id' => 170, 'dst_id' => 1 }
{ 'table' => 'auth_sources', 'src_id' => 1, 'dst_id' => 1, }
{ 'table' => 'auth_sources', 'src_id' => 1, 'dst_id' => 1 }
],
'sync_projects' =>
[
......@@ -61,6 +77,7 @@ my $setup=
}
]
};
# --- END --------------------------------------------------------------
my @parameters= ();
my $op_mode= 'usage';
......@@ -139,7 +156,6 @@ elsif ($op_mode eq 'user')
my $user= $cfg->get_user ($an, $av);
print "user: ", Dumper ($user);
}
}
elsif ($op_mode eq 'syncuser')
{
......@@ -176,7 +192,7 @@ elsif ($op_mode eq 'sync')
print "\n"x3, '='x72, "\n", "Statistics:", Dumper ($ctx->{'stats'});
}
elsif ($op_mode eq 'diag')
elsif ($op_mode eq 'xxxdiag')
{
my $src= read_configs($setup, 'src');
my $dst= read_configs($setup, 'dst');
......@@ -192,7 +208,6 @@ elsif ($op_mode eq 'diag')
# my $src_members= $src->get_project_members (... some project id ...);
# print "src_members: ", Dumper ($src_members);
# print "src: ", Dumper ($src);
}
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment