Not logged in. · Lost password · Register
Forum: General Help and Support General Stuff RSS
Changer username on 'old revisions'
Avatar
gfcarvalho #1
Member for a week · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: Changer username on 'old revisions'
Hey guys

Until today out IT team was using the same local (eg, "ituser") user to login on dokuwiki (It's an debian with apache) and i was using the admin, i have created one user for each one, when i open one page and click on 'old revisions', it shows the revisions history, i would like to know if it's possible to change the username listed to one of the new one?

Basically all the changes were made by me (user=admin) and since i'm now using a new username those changes are registred with admin...

Thanks
Avatar
schplurtz (Moderator) #2
Member since Nov 2009 · 493 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
That's possible. For any page foo, there is a corresponding file data/meta/foo.changes that holds the history of that page.
The .changes files are  TSV  files where the username is the 5th field.

There may exist some other way I'm not aware of, but since your DW is running on Debian, you could type that kind of commands in a terminal. Warning, it's completely untested. You should backup your entire system and make sure you can actually restore the backup before you try this. Don't blindly type the commands, adapt to your situation, check for errors at each step.

sudo systemctl stop apache2
sudo su -s /bin/bash - www-data
oldusername=schplurtz
newusername=ztrulphcs
cd /var/www/html/dokuwiki/data/meta
for ch in $(find . -name '*.changes'); do
  touch -r "$ch" reference.timestamp
  sed -i -e $'s/^\\([^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t\\)'"$oldusername"$'\\(.*\\)/\\1'"$newusername"'\2/' "$ch"
  touch -r reference.timestamp "$ch"
done
rm reference.timestamp
exit
sudo systemctl start apache2
Avatar
gfcarvalho #3
Member for a week · 3 posts
Group memberships: Members
Show profile · Link to this post
Hi @schplurtz

Thank you very much, worked like a charm...

Just one question, when i open the 'old revisions' page, some entries are a little grayed out do you now what those colors mean?

Thanks
This post was edited on 2019-11-07, 19:48 by gfcarvalho.
Avatar
schplurtz (Moderator) #4
Member since Nov 2009 · 493 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
these are the "minor change" revisions.
Avatar
gfcarvalho #5
Member for a week · 3 posts
Group memberships: Members
Show profile · Link to this post
Oh Ok,

Thanks for your help
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-11-12, 05:44:44 (UTC +01:00)