Article View: news.software.nntp
Article #59424Re: Redirect/Saving newsgroup to different newsgroup.
From: 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
Technical Details
Message-ID:
<afrib3$dc3$2@puck.litech.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!lnsnews.lns.cornell.edu!news.litech.org!not-for-mailReferences:
<3D1A0033.9010402@acme.nsc.com> <afqfrp$df$3@puck.litech.org> <ylr8ingdqb.fsf@windlord.stanford.edu>Show Full Headers
Complete Article Headers
Message-ID: <afrib3$dc3$2@puck.litech.org> Subject: Re: Redirect/Saving newsgroup to different newsgroup. Date: Tue, 02 Jul 2002 06:48:03 +0000 From: jeff@litech.org (Jeffrey M. Vinocur) References: <3D1A0033.9010402@acme.nsc.com> <afqfrp$df$3@puck.litech.org> <ylr8ingdqb.fsf@windlord.stanford.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!lnsnews.lns.cornell.edu!news.litech.org!not-for-mail Newsgroups: news.software.nntp Organization: Litech Systems Design Lines: 52 Sender: jeff@litech.org NNTP-Posting-Host: puck.litech.org X-Trace: puck.litech.org 1025592483 13699 208.48.41.224 (2 Jul 2002 06:48:03 GMT) X-Complaints-To: usenet@litech.org NNTP-Posting-Date: Tue, 2 Jul 2002 06:48:03 +0000 (UTC) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Originator: jeff@litech.org (Jeffrey M. Vinocur)