create new tag
, view all tags

Batch Moving and Reparenting of TWiki Topics

How It Is

My company currently uses TWiki for internal project discussion and management. So far, we've done everything in the Main Web, and we've been OK with it. However, it's getting really unwieldy. As a result, I created a _project Web to use as a template, then created three new Webs, one for each project, based on that template. However, moving each topic from Main to its new home requires the following:

  1. Go to topic
  2. Click More
  3. Click Rename/move
  4. Select new Web
  5. Click Rename/move
  6. Select new parent topic
  7. Click Edit
  8. Click Preview
  9. Click Save

Summary: 9 steps (11 mouse clicks) per topic, and even then it leaves each newly-moved topic locked for an hour unless I explicitly unlock it (more clicks).

Result: Carpal tunnel syndrome and crossed eyes.

How It Could Be

Here's my ideal:

  1. Display a list of all the topics in the Main web with a checkbox next to each one. (easy)
  2. At the bottom of the page would be a select box containing a list of Webs, and a text box for the name of the parent topic in the destination Web. (easy)
  3. When I submit, all of the checked topics will be moved and reparented, and their links updated, just as if I had gone through steps 1-9 for each one. (not so easy)

Summary: 2 clicks + typing + 1 click/topic for each destination.

Result: Health, productivity, and happiness.


Stream-of-Consciousness Observations:

  • All of the code to implement this feature obviously already exists, or the "How It Is" section would be a big lie. However, the existing code is scattered among several individual scripts, so an addon would have to rely on a whole of of cutting, pasting, and refactoring of code.
  • The simplest implementation of my proposed solution would result in a lot of unnecessary link updating. For example, let's say TopicA and TopicB are both being moved. TopicB contains a link to TopicA. If TopicA is processed first, TopicB's reference to it would be updated by the rename script, even though the end result of the batch process wouldn't require it. Of course, pre-processing the batch list and including all checked topics on an "exclude from update" list would alleviate the problem somewhat.

-- MichaelBKlein - 17 Aug 2004

To be honest, I find it easier to do this kind of mass move outside of TWiki. As far as I'm concerned, one of the benefits of TWiki being not having a data-base back-end is that one can simply move topic files from one web directory to another and TWiki is none-the-wiser (AFAIKT).

If you have access to and are comfortable with ssh, you can do this with mv command. Personally, I find it convenient to use a general file management program. I use a free one called efileman. Of course, it will be great when TWiki does develop a similar capability. I only offer this as an immediate solution to your needs.

-- LynnwoodBrown - 18 Aug 2004

Thanks, Lynnwood. I had thought of doing something like that, but it wouldn't perform any link checking/updating, and I'd still have to reparent everything manually -- unless I can do a search and replace on the metadata, which I may look into.

-- MichaelBKlein - 18 Aug 2004

You should be able to do search/replace on the metadata. One other thing to consider is how you want this process to affect the user-visible modification dates of topics. If you do things outside of TWiki, you may want to change the modification dates of the files to match the meta data modification time, since search gives bogus results in some cases if the two times are out of sync.

-- ClaussStrauch - 18 Aug 2004

Actually, soon after I posted the earlier comment I remembered it wasn't the full story. If there are other topics referencing the moved topics, you would need to a find/replace to insert the new web reference. I'm not sure about the modification dates issue, however, I have moved the ,v files with the topics.

I didn't mention another program I use which is similar to efileman but also does search/replace. It's called Fileman and is also free, at least for a single user. It also has the very nice feature of letting you send unix commands, which let's me "fill in" the features which the GUI file manager doesn't offer. It's search/replace feature works quite nicely for search/replace topic references, formatted searches and meta-data.

Opps - I almost forgot TWiki's own GlobalReplacePlugin that's recently been developed and should meet all your search/replace needs! (Twiki's moving ahead so quickly of late, it's hard to keep track of all the improvements! smile

-- LynnwoodBrown - 18 Aug 2004

I just discovered this old discussion, because I have this identical need. GlobalReplacePlugin doesn't look to fit my needs.

I understand and am able to do the file manipulations which are discussed above (outside of TWiki), and change the references / links from within the various pages, but how would I then cause those changes to make it into the ",v" files for version control?

-- StevenChristensen - 2012-10-11

I do not recommend to manually change the content of .txt and .txt,v topic files. It is OK to manually move and rename the files in pair (don't forget the corresponding pub/Web/TopicName/ attachment directory). If you want to change the topics use the browser or GlobalReplacePlugin.

-- PeterThoeny - 2012-10-11

A batch move & reparentlng feature would be useful to have for TWiki. TWiki is open source, anyone can propose and implement a feature, and non-programmers can hire a consultant to do that.

-- PeterThoeny - 2012-10-11

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2012-10-11 - 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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.