Deletions are marked like this. | Additions are marked like this. |
Line 42: | Line 42: |
|| '''Martin Gmür''' || Main contact for system configuration ||Martin.Gmuer@axpo.ch || +41-56-200-3872 || |
|| '''Erich Ermel''' || Main contact from Oct-2011 || Erich.Ermel@axpo.ch || T: 056-200-3779, M: 079-915-6241 || || '''Martin Gmür''' || Main contact ||Martin.Gmuer@axpo.ch || T: 056-200-3872, M: 076-489-0874 || || '''Michael Schlegel''' || Contact for DrawMGT operations. Leiter Planung/Dienste || Michael.Schlegel@axpo.ch || +41 56 200 44 25 || |
Line 44: | Line 46: |
|| '''Michael Schlegel''' || Contact for DrawMGT operations. Leiter Planung/Dienste || Michael.Schlegel@axpo.ch || +41 56 200 44 25 || | |
Line 47: | Line 48: |
|| '''Rene Käppeli''' || Axpo Informatik || Rene.Kaeppeli@axpo.ch || T:056-200-4538, M:079/609-6147 || || '''Jörg Leppin''' || Unix/Linux Spezialist || Joerg.Leppin@axpo.ch || T +41-56-200-4569, M +41-79-403-9429 || |
|| '''Rene Käppeli''' || Axpo Informatik || Rene.Kaeppeli@axpo.ch || T:056-200-4538, M:079-609-6147 || || '''Mario Robic''' || Linux/Network specialist || Mario.Robic@axpo.ch || T: 056-200-3367, M: 079-630-3558 || || '''Adele Grandi'' || User administration || Adele.Grandi@axpo.ch || ? || || '''--(Jörg Leppin)--''' || --(Unix/Linux Spezialist)-- || --(Joerg.Leppin@axpo.ch)-- || --(T +41-56-200-4569, M +41-79-403-9429)-- || || '''Axpo IT Hotline''' || For Citrix login support || See also [[https://zg-2.softxs.ch/intern/intern/?state=home-1&event=cvw&depth=0&cid=2073|BUG-2703]] || 0800-55-05-05 || |
NOK Configuration for the Linthal 2015 Project
Contents
- NOK Configuration for the Linthal 2015 Project
- Notes
- Terminology
- Contact Information
- Documentation and Notes on System Updates for Axpo
-
Discussions and Input Data from NOK
- 2009.10.13: Email from GMM
- 2009.10.16: AH/GMM/etc. Meeting in Baden to discuss classification system and workflows
- 2009.10.23: Emails from GMM for Training
- 2009.10.23: Phone call AH/GMM
- 2009.10.30: Email from GMM: Configuration Corrections
- 2009.11.02: Email from GMM: Corrected !ToDo List
- 2009.11.03: Conference Call AH/GMM
- 2009.11.03: Email from GMM: Updated Configuration Files
- 2009.11.03: Updated NOK ToDo List
- 2009.11.19: Phone call AH/GMM
- 2009.11.24: Email from GMM and phone call AH/GMM
- 2009.12.18: Email from GMM
- 2010.01.15: Phone call AH/GMM
- 2010.01.18: Email GMM
- 2010.01.29: Email GMM
- Training Sessions - List of Attendees
- Project to DrawMGT Configuration Mapping
- NOK Document Coding System
- Generated SQL Configuration Files
- Access to Axpo CentOS System
- Changes to the default httpd.conf
- Installing DrawMGT on drawmgt-pswlimmern.axpo.ch
- Switchover lu.softxs.ch --> drawmgt.pswlimmern.axpo.ch Servers
- Deleting Users
- Changing Users and UserRoles
Notes
The official project name is PSW Limmern (Linthal 2015 is a project above, which include PSW Limmern)
NOK is being renamed as Axpo
Axpo Informatic will host our server. They seem to be quite independent of NOK and the Linthal project
- This page describes a configuration method for the Linthal project, which could become a model
- for configuring other project too.
Terminology
- Zust. = Approval (Zustimmung)
- Indextyp = Document code type
Contact Information
Contact Addresses
Main Office
- Axpo AG - Hydroenergie, Parkstrasse 23, CH-5401 Baden
- +41-56-200-4483
Axpo Informatik
- Axpo Informatik AG
- Bruggerstrasse 68, Postfach, CH-5401 Baden
Construction Site
- Tierfeld, Kanton Glarus
Main Office: 3rd floor of the Bauleitung office, a 3-level white container office complex
- CH coordinates: 717 750 / 193 178 (46.879298N, 8.983394E)
Contact Names
Name
Description
Email
Phone
Erich Ermel
Main contact from Oct-2011
T: 056-200-3779, M: 079-915-6241
Martin Gmür
Main contact
T: 056-200-3872, M: 076-489-0874
Michael Schlegel
Contact for DrawMGT operations. Leiter Planung/Dienste
+41 56 200 44 25
Norbet Wohlkinger
Commercial contact
T: 056-933-4483, M: 079-630-3150
Martin Hase
Leiter Baustelle
Emil Bieri
Electro-Mechanical Leiter
Rene Käppeli
Axpo Informatik
T:056-200-4538, M:079-609-6147
Mario Robic
Linux/Network specialist
T: 056-200-3367, M: 079-630-3558
Adele Grandi
User administration
?
Jörg Leppin
Unix/Linux Spezialist
T +41-56-200-4569, M +41-79-403-9429
Axpo IT Hotline
For Citrix login support
See also BUG-2703
0800-55-05-05
Documentation and Notes on System Updates for Axpo
AxpoTaskEmailImplementation - Notes set to Axpo describing the task email updates requested May 2011
Discussions and Input Data from NOK
2009.10.13: Email from GMM
Bewilligungsauflagen Erfassung DrawMGT v02.xlsx - Example spreadsheet for Bewilligungsauflagen
- Request for management of milestone dates, that can be assigned to tasks as due dates. This includes the ability
- change the dates for milestones and have them automatically change the due dates of the tasks.
2009.10.16: AH/GMM/etc. Meeting in Baden to discuss classification system and workflows
- Request for feature (for document/revision security): New flag in Drawings and/or Revision record:
- Public to Bereich
- Public to entire system
Request for feature: New workflow step F Freigabe, a final approval that is performed after all the
other
New ApprovalStatus: Nicht efforderlich (e.g. N/A - Not Required). Rules:
Complete date: must be empty
Initials: optional
- Summary of German language approval steps:
- Offen
- Erteilt
- Erteilt mit Kommentar
- Abgelehnt
- Implement new workflows:
DCAAAAR - Design-Check-App1-App2-App3-App4-Release
DCAAAARS - Design-Check-App1-App2-App3-App4-Release-Submit
RCAAAAR - Receive-Check-App1-App2-App3-App4-Release
RCAAAARS - Receive-Check-App1-App2-App3-App4-Release-Submit
- Request for improved event history to see exactly what was changed in workflows.
Idea for new Comment field for each Approval and Release workflow step
- Did not commit to implementing this feature
- NOK agreed to use tasks/comments for recording comments associated with approvals
New configuration files sent after the meeting from GMM:
2009.10.19 DrawMGT PSW Limmern Struktur v01.xls -- Master configuration file for classifications
- Worksheet Indextyp -- describe drawing code format and file names
- Worksheet Attribute PSW Limmern -- list of all the classification and other reference data
2009.10.19 DrawMGT Indextyp-Attribute v01.xlsx -- List of document code types and their components
2009.10.19 DrawMGT Doktypen-Prozesstyp v01.xlsx -- List of (project) document types and their
- corresponding document code types and workflow types. Note that we will implement the project document type as a classification field, and separate from the documentTypeId.
2009.10.19 DrawMGT Prozesstypen Tabelle v01.xlsx -- List of desired workflows
Note that that attribute lists in the file 2009.10.19 DrawMGT PSW Limmern Struktur v01.xls generally have a set of code letters. E.g. Bereich has code aa. These same codes also appear in the document code definition and the names of the .txt and .sql files (see below).
Montag, 9. November 2009, 13:00 - 16:00, Axpo AG Baden, Teilnehmer: 6 Neue, E. Bieri, M. Gmür Rescheduled to Dri 13th (see below)
Official project name is Change workflow step name The old (original) test system The new update of the data from the meeting or 2009.10.16 should go in the
New/Updated files included in the email: L2015 DrawMGT Indextyp-Attribute v02.xlsx -- Updated system classifications See cfg/linthal/site/config/Settings-CacheFieldDisplay.php L2015 DrawMGT PSW Limmern Struktur v02.xls -- Contract/Group structure Should map to the ContractRef and Groups worksheets in linthal-configuration.xls L2015 DrawMGT Testsystem Korrekturliste v01.xlsx -- List of ToDo items (See below)
L2015 DrawMGT Testsystem Korrekturliste v02.xlsx -- List of ToDo items, with priorities added. (See below) Most corrections should be made in the worksheets in cfg/linthal/site/config/linthal-configuration.xls, and then then loaded into the linthal system and described below.
L2015 DrawMGT Testsystem Korrekturliste v02-AH1.xls -- Updated from conference call with AH/TN remarks Discussion of system configuration ToDo list (attached above). See column 'AH/TN Bemerkungen', for the list of to do items. We need to: I hope we can implement all of these by the end of the week.
linthal-configuration v02.xls -- File returned from GMM. Only the L2015 DrawMGT Rollen v01.xlsx -- List of user roles, and DE names for the roles. L2015 DrawMGT PSW Limmern Struktur v02b.xls -- Updates to contract & group codes, marked in red. (File renamed to v02b from v02)
L2015 DrawMGT Testsystem Korrekturliste v02-AH3.xls - Includes new columns AH/TN Remarks & Status
Create new task type Update L2015 DrawMGT Testsystem Korrekturliste v02-AH4.xls (Bewilligungsauflagen Erfassung DrawMGT v02.xlsx) -- see email from 2009.10.13 above)
Corrected ToDo List L2015 DrawMGT Testsystem Korrekturliste v03.xls
Implement configuration for new Bereich Update user roles TN done (date?) Anleitung_Bestellungserfassung_EBanf v1.2.pdf -- Example Schritt-für-Schritt documetation L2015 DrawMGT PSW Limmern Struktur v05.xls -- Updated Project Structure L2015-DrawMGT-Rollen-v07.xls -- Updated User Roles
Copy of example WebCast
Corrected ToDo List in XLSX and PDF formats: He has set all priorities to 1 & 2, and set completion deadlines for all items.
As seated at table, from Martin's left:
As seated at table, from Martin's left: Nadia Semadeni - Projektleiterin Umwelt (& Bewilligungsauflagen?)
As seated at table, from Martin's left:
This section describes how the mapping from the NOK spreadsheet Worksheet Name NOK Description DrawMGT Table Notes Ref-aaa Bereich ContractRef Ref-b Projektphase ProjectPhaseRef Ref-cc Fachbereich CategoryRef Ref-ddd Objekt LocationRef Ref-eee Kontakt WorkTypeRef Copied also to table Companies s. below Ref-ff Dokumententyp SiteClassification1Ref Keep separate from DocumentTypeRef Lage Lage AlignmentRef Taetigkeit Tätigkeit WorkCategoryRef Archiv Archiv SiteClassification3Ref Veroeffentlichung Veröffentlichung SiteClassification4Ref WorkflowSteps - - ApprovalStatusRef - ApprovalStatusRef German translation of workflow steps Companies - Companies Groups - Groups Users - Users UserRoles - UserRoles A workaround is applied to fullfill NOK requieremnt 9.1 in L2015
Note: NOK calls the drawing code Drawing Code Document Code - Revision Code File Extension aaa - i - b - cc - ddd - eee - ff _ #### - XXX - v ## .yyy Component Description Part Description DrawMGT Mapping aaa Bereich contractId i Intern/Extern Flag siteClassification2Id b Projektphase projectPhaseId cc Fachbereich categoryId ddd Objekt locationId eee Kontakt workTypeId ff Dokumenttyp siteClassification1Id #### Laufnummer (drawingNo) drawingNo XXX Teilnummer, 1-3 alphanumeric characters, optional -none- - -none- v Constant revisionCode (with revisionNo) ## Versionsnummer (revisionNo) revisionNo .yyy File name extension -none-
The NOK configuration information lives in the drawmgt-cfg configuration tree: Most of the configuration is generated from an Excel file: The initial worksheet called The generation is perform by saving each separate worksheet in the Excel file, in tab-separated format, into a file of the same in the data directory. The saving can be mad manually as described below or automatically with an OpenOffice macro E.g. Save the Then run a script to generate SQL files: This script reads the .txt files and outputs .sql files Then load the SQL into the database and run genMeta.pl
Contact is Jörg Leppin. See contacts above.
Public and private key stored at:
A A section was made in An ssh key pair was generated on the Axpo system as user linthal and the content of the public key was copied to
Note that ssl authentication is made by the Axpo, we don't get Disable default character settings to allow using of meta tag
prod & test instances installed: CVS, setup.sh & genMeta (via browser) prod & test databases patched with:
Note: See previous sectino for CVS installation and setup of prod & test instances. Setup and install new 'prod' instance ( cfg/..../InstanceSettings.php exists & is checked-into CVS, but needs checking/testing Note the email test mode is set to Setup and install new 'test' instance ( cfg/..../InstanceSettings.php exists & is checked-into CVS, but needs checking/testing Note the email test mode is set to Update main page and links to prod and test systems (add note to say that delta and beta systems Sind nicht mehr aktuell (or something like that). Setup copy prod --> test job Initial page http://drawmgt-pswlimmern.axpo.ch has new links to the prod and test systems, and warnings that the beta and delta systems are not to be used.
If any of the select above gives other than 0, than the appropriate Users and UserRoles record can not be deleted. Set the user locked instead.
Axpo follows users and user roles in excel table, and is stored in the Linthal-DrawMGT system as document Create a new database for testing the changes and load tables Note that Excel (on the Macat least) is unable to save CSV in URF-8 format. Use OpenOffice instead. Select Note that the genMeta.pl 2009.10.23: Emails from GMM for Training
2009.10.23: Phone call AH/GMM
PSW Limmern.
beta system. 2009.10.30: Email from GMM: Configuration Corrections
2009.11.02: Email from GMM: Corrected !ToDo List
2009.11.03: Conference Call AH/GMM
2009.11.03: Email from GMM: Updated Configuration Files
Users worksheet appears to be updated. 2009.11.03: Updated NOK ToDo List
2009.11.19: Phone call AH/GMM
Bewilligungsauflagen 2009.11.24: Email from GMM and phone call AH/GMM
2009.12.18: Email from GMM
LUe TN done (date?) 2010.01.15: Phone call AH/GMM
2010.01.18: Email GMM
2010.01.29: Email GMM
Training Sessions - List of Attendees
Session 1: 2009-11-10, 13:00, Tuesday, Baden
Session 2: 2009-11-11, 13:00, Wednesday, Tierfeld
Session 3: 2009-11-10, 09:00, Friday, Baden
Project to DrawMGT Configuration Mapping
NOK Document Coding System
Drawing and Revision Code Format
Generated SQL Configuration Files
ContractRef worksheet as ContractRef.txt cd cfg/linthal/site/data
mysql -u... -p...
create database linthal113dev;
use linthal113dev;
source ../../../../app/schema/drawmgt-schema.sql
source ../../../../app/schema/id-table-schema.sql
source ../../../../app/schema/data/refdata.sql
source linthal-configuration.sql
source ../../../../app/schema/id-table-setup.sql
quit
cd ../../../../app/etc
./genMeta.pl
Access to Axpo CentOS System
Access to Axpo External CentOS System
lu.softxs.ch:/root/axpo-ssh ssh root@lu.softxs.ch
ssh -i /root/axpo-ssh/id_rsa user@centos.axpo.ch
Access to Axpo Internal CentOS System
root@SABDN471 ~]# ssh -R5556:localhost:22 root@sabdn470
[root@sabdn470 ~]# while [ 1 ]; do sleep 60; echo -n "."; done
[root@sabdn470 ~]# ssg -p5556 localhost # log in from external to internal in any terminal
Using CVS on the Axpo CentOS External System
.cvsrc file was created in the home directory of linthal on the Axpo system with the content below, to allow the access to the CVS repository through ssh on localhost honir# ssh -R 2401:localhost:22 -i ~/axpo-ssh/id_rsa root@axpo
[root@sabdn470 ~]# su - linthal
[linthal@sabdn470 ~]$ cd www/shtml/delta/app/etc
[linthal@sabdn470 etc]$ cvs -q up
cvs -z9 -d linthal@localhost:/home/cvsroot
Host localhost
Port 2401
[linthal@sabdn470 etc]$ ssh-keygen -t rsa
[linthal@sabdn470 .ssh]$ view ~/.ssh/id_rsa.pub
linthal@honir (~) 499$ vi ~/.ssh/authorized_keys
Using CVS on the Axpo CentOS Internal System
[root@SABDN471 ~]# ssh -L2401:localhost:2401 sabdn470
...
[linthal@SABDN471 ~]$ cd www/shtml/beta1
[linthal@SABDN471 beta1]$ cvs -q up app lib
Changes to the default httpd.conf
charset: [root@sabdn470 ~]# diff /etc/httpd/conf/httpd.conf.091229-1738.orig /etc/httpd/conf/httpd.conf
265a266
> ServerName drawmgt.axpo.ch:80
747c748
< AddDefaultCharset UTF-8
---
> #AddDefaultCharset UTF-8
972c973,974
< #NameVirtualHost *:80
---
> NameVirtualHost *:80
> NameVirtualHost *:443
991a994,1013
>
> <VirtualHost *:80>
> DocumentRoot /home/linthal/www/shtml
> ServerName drawmgt-pswlimmern.axpo.ch
> ServerAlias drawmgt-pswlimmern
> ServerAlias drawmgt-pswlimmern-localhost
> Options -Indexes
> </VirtualHost>
>
> #<VirtualHost *:443>
> # SSLEngine on
> # SSLCertificateFile /etc/pki/tls/certs/ca.crt
> # SSLCertificateKeyFile /etc/pki/tls/private/ca.key
> # <Directory /home/linthal/www/shtml>
> # AllowOverride All
> # </Directory>
> # DocumentRoot /home/linthal/www/shtml
> # ServerName drawmgt-pswlimmern.axpo.ch
> # Options -Indexes
> #</VirtualHost>
Installing DrawMGT on drawmgt-pswlimmern.axpo.ch
# On honir as root
cd /home/met/www/html/prod/app/etc
scp -i ~/axpo-ssh/id_rsa checkout.pl root@axpo:/home/linthal/bin
# On drawmgt-pswlimmern.axpo.ch as root
cd /home/linthal/bin
chown linthal:linthal checkout.pl
# Change the following line:
my $CVS_ROOT = $USER . '@lu.softxs.ch:/home/cvsroot';
# To:
my $CVS_ROOT = $USER . '@localhost:/home/cvsroot';
# As user linthal
cd ~/bin
./checkout.pl \
-v -q \
-r 113 \
-u linthal \
-d /home/linthal/www/shtml \
-s prod \
-w apache \
linthal \
drawmgt-pswlimmern.axpo.ch-prod
# As root:
cd /home/linthal/www/shtml/prod/app/install
./setup.sh linthal drawmgt-pswlimmern.axpo.ch-prod apache linthal
# As user linthal
cd ~/bin
./checkout.pl \
-v -q \
-r 113 \
-u linthal \
-d /home/linthal/www/shtml \
-s test \
-w apache \
linthal \
drawmgt-pswlimmern.axpo.ch-test
# As root:
cd /home/linthal/www/shtml/test/app/install
./setup.sh linthal drawmgt-pswlimmern.axpo.ch-test apache linthal
Switchover lu.softxs.ch --> drawmgt.pswlimmern.axpo.ch Servers
Status of 2009-01-10 17:30
INSERT INTO EventTypeRef VALUES (19, 'PWDCHG', 'Password Change',null,'PwdChange');
rsync -a \
/home/linthal/www/shtml/delta/var/linthal/drawmgt-pswlimmern.axpo.ch-delta/data/ \
/home/linthal/www/shtml/prod/var/linthal/drawmgt-pswlimmern.axpo.ch-prod/data/
rsync -a \
/home/linthal/www/shtml/delta/var/linthal/drawmgt-pswlimmern.axpo.ch-delta/data/ \
/home/linthal/www/shtml/test/var/linthal/drawmgt-pswlimmern.axpo.ch-test/data/
Implementation Steps
On lu.softxs.ch Done cd /home/linthal/www/html/beta
mv index-DISABLED.html index.html
mv index.php index-DISABLED.php
cd /home/linthal/www/html/delta
mv index-DISABLED.html index.html
mv index.php index-DISABLED.php
done)
false
true Deleting Users
$ mysql -uroot -psqladmin linthal113prod
set @u='userId'; -- Use the actual userId
select count(*) from Revisions where checkResponsibleId = @u;
select count(*) from Revisions where startResponsibleId = @u;
select count(*) from Revisions where designResponsibleId = @u;
select count(*) from Revisions where drafterResponsibleId = @u;
select count(*) from Revisions where approver1Id = @u;
select count(*) from Revisions where approver2Id = @u;
select count(*) from Revisions where approver3Id = @u;
select count(*) from Revisions where approver4Id = @u;
select count(*) from Revisions where releaserId = @u;
select count(*) from Revisions where requesterUserId = @u;
select count(*) from Revisions where receiverId = @u;
select count(*) from Submittals where submitterId = @u;
select count(*) from Comments where issuerUserId = @u;
select count(*) from Comments where assignedToUserId = @u;
select count(*) from Comments where delegatedToUserId = @u;
select count(*) from SubmittalRecipients where userId = @u;
Changing Users and UserRoles
ContractRef, Groups, Roles, Users and UserRoles from the production system # export tables Users and UserRoles from the production system
[linthal@sabdn470 ~]$ mysqldump --triggers=false -uroot -psqladmin linthal113prod ContractRef Companies Groups Roles Users UserRoles > /home/backup/linthal113prod_UserRoles_20100430-1550.sql
#
# copy the export to the development machine
$ scp .... /tmp
#
# check the exports character set, likelyhood the CHARSET=latin1 must be changed to CHARSET=utf8
$ vi /tmp/linthal113prod_UserRoles_20100430-1550.sql
:%s/ENGINE=MyISAM DEFAULT CHARSET=latin1/ENGINE=MyISAM DEFAULT CHARSET=utf8/
:x
#
# load the export into a new database
$ mysql -uroot -psqladmin
set names utf8;
create database linthal113_users;
use linthal113_users;
source /tmp/linthal113prod_UserRoles_20100430-1550.sql;
quit;
#
# create csv files from tables as backup for comparing later
$ mysql -uroot -psqladmin linthal113_users -e 'select * from Users where userId >=100 order by UserId' > Users_old.csv
$ mysql -uroot -psqladmin linthal113_users -e 'select * from UserRoles where userId >=100 order by userId, contractId, groupId, roleId' > UserRoles_old.csv
Field delimiter: {tab} $ cd cfg/linthal/site/data
$ ../../../../app/etc/genRefData.pl -t Users -k userId -f Users.txt > Users.sql
#
# The SQL file creates all user records, also the old ones.
$ cp Users.sql Users_new.sql
#
# Delete the records of the old users
$ vi Users_new.sql
:4,NNd
:x
#
# Create the new users
$ mysql -uroot -psqladmin linthal113_users -e 'source Users_new.sql'
#
# Change SQL update records for old users
# Load the records in a temporary record and update the old records
$ cp Users.sql Users_update.sql
$ vi Users_update.sql
:NN,$d # delete all new records
:s/,$/;/ # change comma to semicolon at the end of the line
:1 # goto first line
:s/Users/Users_tmp/ # change tablename
Oset names utf8;
create temporary table Users_tmp like Users; # create temp table in first line
<ESC>
G # go to last line
oupdate Users u, Users_tmp t set u.initials=t.initials, u.firstName=t.firstName, u.lastName=t.lastName, u.description=t.description, u.company=t.company, u.eMail1=t.eMail1, u.loginName=t.loginName, u.defaultContractId=t.defaultContractId, u.defaultGroupId=t.defaultGroupId where u.userId = t.userId;
<ESC>
:x
########### 11.5
update Users u, Users_tmp t set u.initials=t.initials, u.firstName=t.firstName, u.lastName=t.lastName, u.description=t.description, u.companyId=t.companyId, u.company=t.company, u.eMail1=t.eMail1, u.loginName=t.loginName, u.defaultContractId=t.defaultContractId, u.defaultGroupId=t.defaultGroupId, u.restrictedFlag = t.restrictedFlag, u.testUserFlag = t.testUserFlag, u.obsoleteFlag = t.obsoleteFlag, u.loginEnabled = t.loginEnabled where u.userId = t.userId;
###########
#
# Update old users
$ mysql -uroot -psqladmin linthal113_users -e 'source Users_update.sql'
#
# Create UserRoles.sql
$ ../../../../app/etc/genRoles.pl -2 -l -uroot -psqladmin -dlinthal113_users L2015-DrawMGT-Rollen.txt > UserRoles.sql
#
# Load new UserRoles
$ mysql -uroot -psqladmin linthal113_users -e 'delete from UserRoles where userId >= 100'
$ mysql -uroot -psqladmin linthal113_users -e 'source UserRoles.sql'
# Create CSV files again
$ mysql -uroot -psqladmin linthal113_users -e 'select * from Users where userId >=100 order by UserId' > Users_new.csv
$ mysql -uroot -psqladmin linthal113_users -e 'select * from UserRoles where userId >=100 order by userId, contractId, groupId, roleId' > UserRoles_new.csv
#
# Compare with the old version
diff Users_old.csv Users_new.csv
diff UserRoles_old.csv UserRoles_new.csv
#
# Check in the cahnges
cvs ci -m'Updating User Roles and Attributes at Axpo as described in e-mail of Adele Grandi (SUP-2910)' \
L2015-DrawMGT-Rollen.txt UserRoles.sql Users.sql Users.txt Users_new.sql Users_update.sql
[linthal@sabdn470 ~]$ cd www/shtml/prod/cfg/linthal/site/data/
[linthal@sabdn470 data]$ cvs -q up
[linthal@sabdn470 data]$ mysql -uroot -psqladmin linthal113prod
mysql> set names utf8;
mysql> source Users_new.sql
mysql> source Users_update.sql
mysql> update ID_TABLE set NEXT_ID = (select max(userId) from Users) + 1 where TABLE_NAME = 'Users';
mysql> update Users set languageId=2 where userId >= NN;
mysql> update Users set loginEnabled=1, maxLogins=1 where userId >= NN;
mysql> delete from UserRoles where userId >=100;
mysql> source UserRoles.sql;
# from the development machine
$ cd app/etc
$ ./genMeta.pl -n -c https://drawmgt-pswlimmern.axpo.ch/prod/lib/meta
[linthal@sabdn470 data]$ mysql -uroot -psqladmin linthal113prod -e 'select userId, loginName from Users where userId>=NN and password is null' > /tmp/users.lst
[linthal@sabdn470 data]$ vi /tmp/users.lst # Remove the header
:1
dd:x
[linthal@sabdn470 data]$ cd ../../../../app/etc
[linthal@sabdn470 etc]$ ./setPasswords.sh /tmp/users.lst > /tmp/setPasswords.sql
[linthal@sabdn470 etc]$ mysql -uroot -psqladmin linthal113prod -e 'source /tmp/setPasswords.sql'
[linthal@sabdn470 etc]$ rm /tmp/users.lst /tmp/setPasswords.sql