Tags:
create new tag
view all tags

SID-01209: How to copy a topic with history

Status: Answered Answered TWiki version: 5.0.0 Perl version:
Category: CategoryEditing Server OS: Last update: 14 years ago

Hello

I work with the twiki 5.0.0. I wish to perform a copy of a topic with a different name. In addition, all versions of the topic copied shall be copied too. I have already read this thread about topic copies : HowToCopyATopic

I used the twiki edit scripts to perform the copy. But this script only performs a copy of the last revision of the orignal topic. How to perfom a copy of topic with their revisions ?

Thanks in advance

-- ChenalBenoit - 2011-06-22

Discussion and Answer

The templatetopic option to the edit and save script does not carry over the topic history. I was going to say that you need to write a plugin that uses the API to copy a topic with its history, but there is no TWikiFuncDotPm API call to do that. As a workaround you can create a small cgi script that copies files. Example shell commands:

cd /path/to/twiki
cp -p data/Myweb/OriginalTopic.txt data/Myweb/NewTopic.txt
cp -p data/Myweb/OriginalTopic.txt,v data/Myweb/NewTopic.txt,v
cp -pr pub/Myweb/OriginalTopic pub/Myweb/NewTopic

It is probably wise to check if the new topic exists, and return an error if it does.

-- PeterThoeny - 2011-06-22

Ok thanks I'll try .... Just another question and after that I will close the topic. I will copy the topic attachements. Can I do that by using this method too ?

-- ChenalBenoit - 2011-06-27

I updated above example to include also the attached files.

-- PeterThoeny - 2011-06-27

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title How to copy a topic with history
SupportCategory CategoryEditing
TWiki version 5.0.0
Server OS

Web server

Perl version

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2011-06-27 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.