Difference between revisions of "Rollover for the manual"

From Gramps
Jump to: navigation, search
(Rolling over the Gramps user manual)
(35 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Use phpmyadmin to backup all of the wiki tables!
+
{{man warn|Notes for the [email protected]|Used in the maintenance of the Gramps website}}
 +
Technical details on how the Gramps wiki [[User manual]] is updated for each release.
  
Locate all pages on the wiki that have 3.0 in the title - from the wiki: toolbox, Special pages, All pages to get a full list of wiki pages.  Copy/paste it into Open Office word processor - it is in three columns separated by tabs.  Use regular expression search/replace to replace tabs with carriage returns - now have a list of all files on the wiki, one title per line.  Save it as a text file (I'll call it myfile.txt for this example).
+
{{stub}}<!--check instructions-->
  
Use grep to find only the pages with 3.0 in the title:
+
== Rolling over the Gramps user manual ==
grep "3.0" myfile.txt > mynewfile.txt
+
On this page, <code>5.x</code> refers to the 'old' (current) version of the manual - <code>5.z</code> refers to the new, to be created, version...
 +
#Use phpmyadmin to backup all of the wiki tables (or the commandline if phpmyadmin times out!)!
 +
#Locate all pages on the wiki that have <code>5.x</code> in the title - from the {{man label|wiki: toolbox, Special pages}}, All pages to get a full list of wiki pages. 
 +
#Copy/paste it into text processor - it may be in three columns separated by tabs.  If so, use regular expression search/replace to replace tabs with carriage returns.  Using GEDIT, best to replace <code>\t</code> with <code>\n</code> rather than <code>\r</code>.  You now have a list of all files on the wiki, one title per line.  Save it as a text file (I'll call it <code>myfile.txt</code> for this example).
 +
#Use grep to find only the pages with <code>5.x</code> in the title: ''<code>grep "5\.x" myfile.txt > mynewfile.txt</code>'' The backslash will make the full stop a literal rather than trying to be part of a regular expression.
 +
#Use a text editor to view the new file, and delete any pages that you don't want to roll over (That is, some pages may refer to <code>5.x</code> in the title, but are not pages that we want duplicated into <code>5.z</code>...)
 +
#Copy/paste the new list of page titles into the wiki export using toolbox, Special pages, Export pages and create the xml to screen.  {{man menu|Be sure box for Include only the current revision, not the full history is ticked.}}
 +
#Copy/paste the xml into a text processor and use search/replace to replace <code>5.x</code> with <code>5.z</code>
 +
#Save the file (I'll call it <code>export.xml</code> for this example).
  
Use a text editor to view the new file, and delete any pages that you don't want to roll over (That is, some pages may refer to 3.0 in the title, but are not pages that we want duplicated into 3.1...)
+
For the change to <code>5.4</code> and then from <code>5.4</code> to <code>6.0</code>, I used a script in the maintenance directory to import xml from the command line. I was successful with (but I got an error in <code>importDump.php</code> and had to edit the file to ensure that <code>Maintenance.php</code> was included properly!):
  
Copy/paste the new list of page titles into the wiki export using toolbox, Special pages, Export pages and create the xml to screen. Be sure box for Include only the current revision, not the full history is ticked.
+
'''-bash-3.2$<code>php importDump.php 54.xml</code>'''
  
Copy/paste the xml into a text processor and use search/replace to replace 3.0 with 3.1
+
followed by:
  
Save the file (I'll call it export.xml for this example).
+
'''-bash-3.2$<code>php rebuildrecentchanges.php</code>'''
  
Import the new pages into the wiki: toolbox, Special pages, Restricted special pages (available only to Sysop members of the wiki), Import pages.  Browse to find the .xml file and Upload file.
+
That should now have created all of the new pages.
 +
 
 +
{{man warn|Update searchindex table|New pages created by this sort of import do not automatically get added into the search index of the wiki.  Use phpmyadmin from the cpanel and use the repair tool for the searchindex table.''}}
 +
 
 +
Finally, if you want to set all the previous version pages to be protected, so only sysop mediawiki users are able to make changes (so all changes will be forced into the next set of pages...), you can use a series of sql statements in the form:
 +
<pre>
 +
UPDATE `grampswiki`.`page` SET `page_restrictions` = 0x656469743d7379736f703a6d6f76653d7379736f70 WHERE `page`.`page_title` ='Title_of_the_page_in_the_wiki' collate utf8_unicode_ci LIMIT 1;
 +
</pre>
 +
({{man menu|You'll need to replace the spaces in the page title with underscores...}})
 +
 
 +
I do that concatenation in a spreadsheet, creating the (long) SQL statements by combining a first part, the page names and the last part.  You'll need to search for any single quotes and put a backslash in front of them in the page names first, too...
 +
 
 +
That updates a blob field to force protection without having to do the pages individuallyYou need to do the above sql statement for each page that you want to protect...
 +
 
 +
*Screenshots
 +
As there is no [[Screenshots|naming scheme]] we are trying to follow a rule for manual upgrade :
 +
* <code>filename-{number of version}-{lang}.extension</code>
 +
ex:
 +
* <code>Edit-person-50-en.png</code>
 +
We need to know if we keep the {number of version} or if we use the new one on migration (3.1->3.2->4.0->15.0...) ?
 +
 
 +
==See also==
  
There are serious restrictions for both file size and processing time for the scripts - I had to split the .xml file into 8 pieces to get it all uploaded...
+
* [[User manual]]
 +
* [[Manual Generation 3.0]]
  
That should now have created all of the new pages.
 
  
New pages created by this sort of import do not automatically get added into the search index of the wiki.  Use phpmyadmin from the cpanel and use the repair tool for the searchindex table.
+
[[Category:Developers/General]]

Revision as of 00:09, 29 May 2018

Gnome-important.png
Notes for the [email protected]

Used in the maintenance of the Gramps website

Technical details on how the Gramps wiki User manual is updated for each release.

Gramps-notes.png

This article's content is incomplete or a placeholder stub.
Please update or expand this section.


Rolling over the Gramps user manual

On this page, 5.x refers to the 'old' (current) version of the manual - 5.z refers to the new, to be created, version...

  1. Use phpmyadmin to backup all of the wiki tables (or the commandline if phpmyadmin times out!)!
  2. Locate all pages on the wiki that have 5.x in the title - from the wiki: toolbox, Special pages, All pages to get a full list of wiki pages.
  3. Copy/paste it into text processor - it may be in three columns separated by tabs. If so, use regular expression search/replace to replace tabs with carriage returns. Using GEDIT, best to replace \t with \n rather than \r. You now have a list of all files on the wiki, one title per line. Save it as a text file (I'll call it myfile.txt for this example).
  4. Use grep to find only the pages with 5.x in the title: grep "5\.x" myfile.txt > mynewfile.txt The backslash will make the full stop a literal rather than trying to be part of a regular expression.
  5. Use a text editor to view the new file, and delete any pages that you don't want to roll over (That is, some pages may refer to 5.x in the title, but are not pages that we want duplicated into 5.z...)
  6. Copy/paste the new list of page titles into the wiki export using toolbox, Special pages, Export pages and create the xml to screen. Be sure box for Include only the current revision, not the full history is ticked.
  7. Copy/paste the xml into a text processor and use search/replace to replace 5.x with 5.z
  8. Save the file (I'll call it export.xml for this example).

For the change to 5.4 and then from 5.4 to 6.0, I used a script in the maintenance directory to import xml from the command line. I was successful with (but I got an error in importDump.php and had to edit the file to ensure that Maintenance.php was included properly!):

-bash-3.2$php importDump.php 54.xml

followed by:

-bash-3.2$php rebuildrecentchanges.php

That should now have created all of the new pages.

Gnome-important.png
Update searchindex table

New pages created by this sort of import do not automatically get added into the search index of the wiki. Use phpmyadmin from the cpanel and use the repair tool for the searchindex table.

Finally, if you want to set all the previous version pages to be protected, so only sysop mediawiki users are able to make changes (so all changes will be forced into the next set of pages...), you can use a series of sql statements in the form:

UPDATE `grampswiki`.`page` SET `page_restrictions` = 0x656469743d7379736f703a6d6f76653d7379736f70 WHERE `page`.`page_title` ='Title_of_the_page_in_the_wiki' collate utf8_unicode_ci LIMIT 1;

(You'll need to replace the spaces in the page title with underscores...)

I do that concatenation in a spreadsheet, creating the (long) SQL statements by combining a first part, the page names and the last part. You'll need to search for any single quotes and put a backslash in front of them in the page names first, too...

That updates a blob field to force protection without having to do the pages individually. You need to do the above sql statement for each page that you want to protect...

  • Screenshots

As there is no naming scheme we are trying to follow a rule for manual upgrade :

  • filename-{number of version}-{lang}.extension

ex:

  • Edit-person-50-en.png

We need to know if we keep the {number of version} or if we use the new one on migration (3.1->3.2->4.0->15.0...) ?

See also