Thread View: news.software.nntp
10 messages
10 total messages
Started by Prakash Subramanian
Wed, 26 Jun 2002 17:56
Redirect/Saving newsgroup to different newsgroup.
Author: Prakash Subramanian
Date: Wed, 26 Jun 2002 17:56
Date: Wed, 26 Jun 2002 17:56
31 lines
2196 bytes
2196 bytes
Hello, I am trying to move few local newsgroups between two servers A and B running INN 2.3.3. I was able to recieve messages from A to B with the same newsgroup name, but I want to recieve a newsgroups ng1 on A to ng2 on B (not ng1 on B). This is what happening now. Newsgroup Server - A => Newsgroup Server - B Newsgroup - ng1 => Newsgroup - ng1 This is what I need Newsgroup Server - A => Newsgroup Server - B Newsgroup - ng1 => Newsgroup - ng2 I have configure Newsgroup Server - B active file as follows. ng1 0000000000 0000000001 =ng2 (What I understood by this is if any articles targeting ng1 should go to ng2 and the articles headers are modified to look like ng2's articles . am I missing anything here?) PS: Also is there any documents about renaming a newsgroup in inn 2.3.3. Please help. Thanks, Prakash
Re: Redirect/Saving newsgroup to different newsgroup.
Author: Jeffrey M. Vinocur
Date: Mon, 01 Jul 2002 20:59
Date: Mon, 01 Jul 2002 20:59
37 lines
2329 bytes
2329 bytes
In article <3D1A0033.9010402@acme.nsc.com>, Prakash Subramanian <prakash@acme.nsc.com> wrote: > >I am trying to move few local newsgroups between two servers A and B >running INN 2.3.3. I was able to recieve messages from >A to B with the same newsgroup name, but I want to recieve a newsgroups >ng1 on A to ng2 on B (not ng1 on B). This tends to be a pain. It's also a frequently asked question. (Russ, perhaps it should go in the INN FAQ.) If you check google groups you should find some previous discussion. It may be a bit easier for you because you're changing servers in the process. (Are you using xrefslave on B? That would make it potentially more complicated) You could probably modify innxmit to do the necessary transformations (on the Newsgroups: line, and perhaps on the Xref: line as well). >I have configure Newsgroup Server - B active file as follows. >ng1 0000000000 0000000001 =ng2 Oo. Y'know, I have no idea how aliased groups really work. Can anybody else chime in here? >PS: Also is there any documents about renaming a newsgroup in inn 2.3.3. Don't believe so. (It's something that only makes sense on internal news servers, and as a result isn't a tremendously common issue...although the number of questions here belie that.) -- Jeffrey M. Vinocur jeff@litech.org
Re: Redirect/Saving newsgroup to different newsgroup.
Author: Russ Allbery
Date: Tue, 02 Jul 2002 00:44
Date: Tue, 02 Jul 2002 00:44
32 lines
2320 bytes
2320 bytes
Jeffrey M Vinocur <jeff@litech.org> writes:
> Prakash Subramanian <prakash@acme.nsc.com> wrote:
>> I am trying to move few local newsgroups between two servers A and B
>> running INN 2.3.3. I was able to recieve messages from A to B with the
>> same newsgroup name, but I want to recieve a newsgroups ng1 on A to ng2
>> on B (not ng1 on B).
> This tends to be a pain. It's also a frequently asked question.
> (Russ, perhaps it should go in the INN FAQ.)
Do we have a good answer for it? I guess for the general case of moving a
newsgroup to another group on the same host, the answer is to dump all the
articles into separate files, change the newsgroups headers, and reinject
them.
>> I have configure Newsgroup Server - B active file as follows.
>> ng1 0000000000 0000000001 =ng2
> Oo. Y'know, I have no idea how aliased groups really work. Can anybody
> else chime in here?
This should work provided you're not using xrefslave. I'm guessing
xrefslave and aliased groups won't play well together, although I've not
specifically tested.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Redirect/Saving newsgroup to different newsgroup.
Author: Jeffrey M. Vinocur
Date: Tue, 02 Jul 2002 06:48
Date: Tue, 02 Jul 2002 06:48
53 lines
2895 bytes
2895 bytes
In article <ylr8ingdqb.fsf@windlord.stanford.edu>,
Russ Allbery <rra@stanford.edu> wrote:
>Jeffrey M Vinocur <jeff@litech.org> writes:
>
>> [ renaming newsgroups / moving articles to a different group ]
>
>> (Russ, perhaps it should go in the INN FAQ.)
>
>Do we have a good answer for it? I guess for the general case of moving a
>newsgroup to another group on the same host, the answer is to dump all the
>articles into separate files, change the newsgroups headers, and reinject
>them.
Well, there are two subtly different questions, as I see it:
- Renaming a group. In this case you probably want everything to
be exactly the same except for the group name, including most
likely Message-IDs. This is feasible in tradspool by moving
the files, applying some simple Perl, rebuilding
history/overview after you're done.
- Moving articles to a different, existing, group (or merging
groups). In this case, you can't preserve article numbers,
certainly. In order to get the server to assign numbers,
you'd need to reinject the articles (either munging the
Message-IDs or purging them from history first).
Alternatively, you could very carefully assign the article
numbers yourself, and then rebuild everything as above.
Personally, I hope I never have to do either. But people seem to
want to do this (more often the first one, I think), and we
should at least provide the bit of Perl needed to do this with
tradspool. Something like this (essentially untested):
#!/usr/bin/perl -wi
my ($src, $dst) = (shift, shift);
die "Usage: $0 oldgroup newgroup [file1 [file2 ...]]\n" unless(defined $dst);
while(<>) {
s/$src/$dst/gi if 1 .. /^$/ and /^(Newsgroups|Xref):/;
print;
} continue {
close ARGV if eof;
}
--
Jeffrey M. Vinocur
jeff@litech.org
Re: Redirect/Saving newsgroup to different newsgroup.
Author: Prakash Subramanian
Date: Wed, 03 Jul 2002 23:04
Date: Wed, 03 Jul 2002 23:04
79 lines
3852 bytes
3852 bytes
Hi,
Since I am using tradspool, I renamed newsgroup A to new newsgroup B and
I was able to use a perl script to change the headers as follows.
perl -pi -e 's/^(Newsgroups|Followup-To|Xref)(: .*)A(.*)$/\1\2B\3/' *
Then, I deleted both history/databases and overview and re-created
everything from the spool as follows.
makehistory -b -O
When I feed this newsgroup to a peer, it fails to send them. No error
messages. Newsreaders can see newsgroups on A too.
How do I change MessageID if this is the one causing the problem.
Thanks
-Prakash
Jeffrey M. Vinocur wrote:
> In article <ylr8ingdqb.fsf@windlord.stanford.edu>,
> Russ Allbery <rra@stanford.edu> wrote:
>
>>Jeffrey M Vinocur <jeff@litech.org> writes:
>>
>>
>>>[ renaming newsgroups / moving articles to a different group ]
>>>
>>>(Russ, perhaps it should go in the INN FAQ.)
>>>
>>Do we have a good answer for it? I guess for the general case of moving a
>>newsgroup to another group on the same host, the answer is to dump all the
>>articles into separate files, change the newsgroups headers, and reinject
>>them.
>>
>
> Well, there are two subtly different questions, as I see it:
>
> - Renaming a group. In this case you probably want everything to
> be exactly the same except for the group name, including most
> likely Message-IDs. This is feasible in tradspool by moving
> the files, applying some simple Perl, rebuilding
> history/overview after you're done.
>
> - Moving articles to a different, existing, group (or merging
> groups). In this case, you can't preserve article numbers,
> certainly. In order to get the server to assign numbers,
> you'd need to reinject the articles (either munging the
> Message-IDs or purging them from history first).
> Alternatively, you could very carefully assign the article
> numbers yourself, and then rebuild everything as above.
>
> Personally, I hope I never have to do either. But people seem to
> want to do this (more often the first one, I think), and we
> should at least provide the bit of Perl needed to do this with
> tradspool. Something like this (essentially untested):
>
>
> #!/usr/bin/perl -wi
>
> my ($src, $dst) = (shift, shift);
> die "Usage: $0 oldgroup newgroup [file1 [file2 ...]]\n" unless(defined $dst);
>
> while(<>) {
> s/$src/$dst/gi if 1 .. /^$/ and /^(Newsgroups|Xref):/;
> print;
> } continue {
> close ARGV if eof;
> }
>
>
>
>
Re: Redirect/Saving newsgroup to different newsgroup.
Author: Russ Allbery
Date: Wed, 03 Jul 2002 23:34
Date: Wed, 03 Jul 2002 23:34
35 lines
2422 bytes
2422 bytes
Prakash Subramanian <prakash@acme.nsc.com> writes:
> Since I am using tradspool, I renamed newsgroup A to new newsgroup B and
> I was able to use a perl script to change the headers as follows.
> perl -pi -e 's/^(Newsgroups|Followup-To|Xref)(: .*)A(.*)$/\1\2B\3/' *
> Then, I deleted both history/databases and overview and re-created
> everything from the spool as follows.
> makehistory -b -O
> When I feed this newsgroup to a peer, it fails to send them. No error
> messages.
They're too old. Your peer is looking at the Date header on the messages
and rejecting them because they're more than X days in the past. At this
point, that peer has now remembered those message IDs and won't accept
them again even if the Date header has changed.
Unfortunately, at this point you have to either wait for those entries to
expire out of the history file or remove them by hand after stopping the
server and rebuilding the databases with makedbz afterwards. Then you can
do:
ctlinnd param c 0
to turn off date checking and try again.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Redirect/Saving newsgroup to different newsgroup.
Author: Russ Allbery
Date: Fri, 23 Aug 2002 17:39
Date: Fri, 23 Aug 2002 17:39
96 lines
5842 bytes
5842 bytes
Jeffrey M Vinocur <jeff@litech.org> writes:
> Well, there are two subtly different questions, as I see it:
> - Renaming a group. In this case you probably want everything to
> be exactly the same except for the group name, including most
> likely Message-IDs. This is feasible in tradspool by moving
> the files, applying some simple Perl, rebuilding
> history/overview after you're done.
> - Moving articles to a different, existing, group (or merging
> groups). In this case, you can't preserve article numbers,
> certainly. In order to get the server to assign numbers,
> you'd need to reinject the articles (either munging the
> Message-IDs or purging them from history first).
> Alternatively, you could very carefully assign the article
> numbers yourself, and then rebuild everything as above.
> Personally, I hope I never have to do either. But people seem to want
> to do this (more often the first one, I think), and we should at least
> provide the bit of Perl needed to do this with tradspool.
Thanks. I have now added this to the FAQ:
URL: <http://www.eyrie.org/~eagle/faqs/inn.html#S6.5>
Subject: 6.5. Rename a newsgroup
INN has no native support for renaming a newsgroup, and doing so is
difficult, so the best advice is to not do this. If there's a way that
you can just create the new newsgroup, encourage people to start using it,
and then remove the old newsgroup, I recommend that. It's much easier.
However, if it really must be done, it's best if you're using the
tradspool storage method. The newsgroup of an article is stored in the
Newsgroups header and Xref header of the article as stored on disk (and
possibly in Followup-To), as well as determining where the overview
information is stored, and in the case of tradspool is also encoded in the
article's storage token. To rename a newsgroup in tradspool, stop the
server, move the directory containing all of the articles to its
appropriate new location in the news spool, edit every article to change
the old name to the new name in Newsgroups, Followup-To, and Xref, and
then rebuild history and overview with makehistory.
The following bit of Perl may help with the renaming (from Jeffrey
Vinocur):
#!/usr/bin/perl -wi
my ($src, $dst) = (shift, shift);
die "Usage: $0 oldgroup newgroup [file1 [file2 ...]]\n"
unless(defined $dst);
while(<>) {
s/$src/$dst/g if 1 .. /^$/ and /^(Newsgroups|Followup-To|Xref):/i;
print;
} continue {
close ARGV if eof;
}
If any articles were crossposted to other newsgroups, you'll also have to
find and recreate the links in those newsgroups to the new location of the
articles (if the links were hard links and the process of changing the
Xref, Followup-To, Newsgroups headers didn't break those links, you may be
lucky and be able to skip this).
If you're using another storage method, this is harder, although with
timehash you may be able to just change the Newsgroups, Xref, Followup-To
headers of the articles in that newsgroup and then rebuild history and
overview as above.
One other approach that can be used regardless of storage method is to
refeed the articles to the server into a new newsgroup. This approach
works best if you're also changing news servers at the same time;
otherwise, the message IDs of the articles will already be in history, and
you'll have to change the message IDs of all of the messages or remove
them from the history database (such as by moving the articles away,
changing /remember/ to 0 so that old history entries won't be retained,
and then running expire to purge them out of history). To do this, get
all of the messages into a directory (by pulling them down via NNTP or
some other method), change the Newsgroups, Xref, and Followup-To headers
to rename the newsgroup, and then create a file containing paths to all of
the articles, one per line. You can then use that file as input to
innxmit, pointing it at the server to which to feed the articles, and if
the articles aren't listed in history on that server and it carries the
new group, they will be accepted into the new newsgroup.
Note that if you use this method and something goes wrong the first time,
the message IDs will probably have all been added to history on the new
server and the articles now will never be accepted until those entries are
removed from history again (or all the message IDs changed).
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Redirect/Saving newsgroup to different newsgroup.
Author: Jeffrey M. Vinocur
Date: Fri, 23 Aug 2002 22:52
Date: Fri, 23 Aug 2002 22:52
43 lines
2697 bytes
2697 bytes
In article <ylr8gpv5in.fsf@windlord.stanford.edu>, Russ Allbery <rra@stanford.edu> wrote: > > s/$src/$dst/g if 1 .. /^$/ and /^(Newsgroups|Followup-To|Xref):/i; I just realized this may subtly break things in obscure cases where the $src newsgroup is a proper substring of some other existing newsgroup used for crossposting (or followups). I suppose the code could probably be fixed by something like s/[^-.+[:alnum:]]$src[^-.+[:alnum:]]/$dst/g if 1 .. /^$/ and /^(Newsgroups|Followup-To|Xref):/i; or whatever (I'm not sure exactly what the characterset for newsgroup names is offhand), but boy is it ugly. (Also untested.) >One other approach that can be used regardless of storage method is to >refeed the articles to the server into a new newsgroup. Want to mention the new refeeding program that somebody just submitted? (Hmm, I guess there could be an option for that to take care of the find-replace and even the Message-ID tweaking if desired. Russ, does this even make sense, or am I falling asleep at the keyboard?) >Note that if you use this method and something goes wrong the first time, >the message IDs will probably have all been added to history on the new >server and the articles now will never be accepted until those entries are >removed from history again (or all the message IDs changed). How hard would it be to supply a tool (or bit of script in the FAQ itself) to remove Message-IDs from history? I've never played with the history database, but it can't be that hard, can it? -- Jeffrey M. Vinocur jeff@litech.org
Re: Redirect/Saving newsgroup to different newsgroup.
Author: Russ Allbery
Date: Fri, 23 Aug 2002 23:11
Date: Fri, 23 Aug 2002 23:11
41 lines
2894 bytes
2894 bytes
Jeffrey M Vinocur <jeff@litech.org> writes:
> I just realized this may subtly break things in obscure cases where the
> $src newsgroup is a proper substring of some other existing newsgroup
> used for crossposting (or followups). I suppose the code could probably
> be fixed by something like
> s/[^-.+[:alnum:]]$src[^-.+[:alnum:]]/$dst/g
> if 1 .. /^$/ and /^(Newsgroups|Followup-To|Xref):/i;
> or whatever (I'm not sure exactly what the characterset for newsgroup
> names is offhand), but boy is it ugly. (Also untested.)
I bailed on this and just documented the problem, since you can have
almost anything in a newsgroup name.
> Want to mention the new refeeding program that somebody just submitted?
> (Hmm, I guess there could be an option for that to take care of the
> find-replace and even the Message-ID tweaking if desired. Russ, does
> this even make sense, or am I falling asleep at the keyboard?)
I think I missed the refeeding program, but in general that would make
sense.
> How hard would it be to supply a tool (or bit of script in the FAQ
> itself) to remove Message-IDs from history? I've never played with the
> history database, but it can't be that hard, can it?
Not *too* hard, although you have to find the message ID by hash and
you'll have to stop the server, so it's more than I think I can write in
the FAQ. But it could be provided as a tool with INN and wouldn't be too
hard to write.
Maybe an option to grephistory? (Making it even more poorly named?)
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Redirect/Saving newsgroup to different newsgroup.
Author: Jeffrey M. Vinocur
Date: Sat, 24 Aug 2002 04:11
Date: Sat, 24 Aug 2002 04:11
54 lines
3041 bytes
3041 bytes
In article <yl3ct5mapu.fsf@windlord.stanford.edu>, Russ Allbery <rra@stanford.edu> wrote: > >> s/[^-.+[:alnum:]]$src[^-.+[:alnum:]]/$dst/g > >I bailed on this and just documented the problem, since you can have >almost anything in a newsgroup name. Heh. Fine by me. (The more readable that code, the better.) (The opposite approach, of course, would be to require [:,[:space:]] before and ([:,[:space:]]|$) after, I guess.) Oh, and we have problems if any of those headers are wrapped onto the next line, but I guess nobody will ever encounter that in practice. >> Want to mention the new refeeding program that somebody just submitted? >> (Hmm, I guess there could be an option for that to take care of the >> find-replace and even the Message-ID tweaking if desired. > >I think I missed the refeeding program, but in general that would make >sense. Uh, contrib/respool.c, I meant. I just took a glance, and I think that could handle it without too much trouble. >> How hard would it be to supply a tool (or bit of script in the FAQ >> itself) to remove Message-IDs from history? > >Not *too* hard, although you have to find the message ID by hash and >you'll have to stop the server, so it's more than I think I can write in >the FAQ. But it could be provided as a tool with INN and wouldn't be too >hard to write. I think people forget to set artcutoff before trying to feed old articles with sufficient frequency that it would be worthwhile. On the otherhand, I think those are mostly people with small servers, and now that makehistory seems reliable, there's really no reason they can't take the server down briefly, makehistory and then makedbz. >Maybe an option to grephistory? (Making it even more poorly named?) Hrm. It would fit in there easily enough, and that actually makes sense user-interface-wise, in a slightly twisted way. -- Jeffrey M. Vinocur jeff@litech.org
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads