Update Znuny 7.0.12

Moderator: crythias

Post Reply
Manfred89
Znuny newbie
Posts: 53
Joined: 14 Jun 2023, 21:44
Znuny Version: 6.5.8
Real Name: Manfred

Update Znuny 7.0.12

Post by Manfred89 »

Hey guys,

I would like to update my test system Znuny 6.5.4 to 7.0.12.

I have tried the following instructions:
https://doc.znuny.org/znuny/releases/in ... e-7.0.html

I come across the following text:
Important

The base settings have been changed to reflect the new product name. During an update, you should verify the following settings to use the new user and path during an update. We recommend creating a new znuny user to /opt/znuny for the best compatibility and changing the following variables.

$Self->{Home}
$Self->{'Frontend::WebPath'}
$Self->{'ScriptAlias'}
$Self->- {'Ticket::Article::Backend::MIMEBase::ArticleDataDir`}

Also, any scripts like backup.pl or apache configurations like DocumentRoot or directives like <Directory> should be verified and changed if you are moving to /opt/znuny.

Should you stay with /opt/otrs, you must ensure that the paths in scripts/apache2-perl-startup.pl and apache2-httpd.include.conf, are verified and changed. Ensure you use the correct user when running bin/znuny.SetPermissions.pl --znuny-user otrs If you use the backup.pl and stay with otrs, also check the backup.pl if you use this.
$Self->{Home}
$Self->{'Frontend::WebPath'}
$Self->{'ScriptAlias'}
$Self->- {'Ticket::Article::Backend::MIMEBase::ArticleDataDir`}
Which files do I have to adapt for this? Is this related to the Config.pm, if you have the variables in it?
Also, any scripts like backup.pl or apache configurations like DocumentRoot or directives like <Directory> should be verified and changed if you are moving to /opt/znuny.
I did not find anything conspicuous in backup.pl.

-------------------------------------------

I have configured the following:

Code: Select all

servicedesk@testsystem:~$ su -
Password:
testsystem ~ # systemctl stop apache2.service
testsystem ~ # systemctl stop postfix
testsystem ~ # su -c 'bin/Cron.sh stop' - otrs
testsystem ~ # su -c 'bin/otrs.Daemon.pl stop' - otrs

-------------------------------------------------------------------------

testsystem ~ # useradd -d /opt/znuny -c 'Znuny user' -g www-data -s /bin/bash -M -N znuny
testsystem ~ # vi /opt/otrs/Kernel/Config.pm
		    $Self->{Home} = '/opt/znuny';

testsystem ~ # cd /opt
testsystem opt # wget https://download.znuny.org/releases/znuny-latest-7.0.tar.gz
testsystem opt # tar xzf znuny-latest-7.0.tar.gz
testsystem opt # rm znuny-latest-7.0.tar.gz
testsystem opt # ls -l
total 16
drwxr-xr-x 4 root root     4096 Nov 12 16:25 backup
lrwxrwxrwx 1 root root       16 Nov 12 17:24 otrs -> /opt/znuny-6.5.4
drwxr-xr-x 9 otrs www-data 4096 Nov 12 17:25 znuny-6.5.4
drwxr-xr-x 9 root root     4096 Oct 18 10:33 znuny-7.0.12
testsystem opt # /opt/znuny-7.0.12/bin/znuny.SetPermissions.pl
Setting permissions on /opt/znuny-7.0.12
testsystem opt # cp -av /opt/otrs/Kernel/Config.pm /opt/znuny-7.0.12/Kernel/
'/opt/otrs/Kernel/Config.pm' -> '/opt/znuny-7.0.12/Kernel/Config.pm'
testsystem opt # rm /opt/otrs
testsystem opt # ln -s /opt/znuny-7.0.12 /opt/znuny
testsystem opt # /opt/znuny/bin/otrs.CheckModules.pl --all

---------------------------------------------------------------------

testsystem opt # rm /etc/apache2/conf-available/zzz_znuny.conf
testsystem opt # ln -s /opt/znuny/scripts/apache2-httpd.include.conf /etc/apache2/conf-available/zzz_znuny.conf
testsystem opt # vi /etc/apache2/sites-available/100-name-ssl.conf
[i]		ScriptAlias /otrs/ "/opt/znuny/bin/cgi-bin/"
		Alias /otrs-web/ "/opt/znuny/var/httpd/htdocs/"

		RewriteRule "^/$" "/znuny/customer.pl"

		# Setup environment and preload modules
		Perlrequire /opt/znuny/scripts/apache2-perl-startup.pl[/i]

-----------------------------------------------------------------------

testsystem opt # su - znuny
znuny@testsystem:~$ scripts/MigrateToZnuny7_0.pl

 Migration started ...

 Checking requirements ...

    Requirement check for: Check required Perl version ...
    Requirement check for: Check required database version ...
    Requirement check for: Check database charset ...
    Requirement check for: Check required Perl modules ...
    Requirement check for: Check if database has been backed up ...

        Did you backup the database? [Y]es/[N]o: Y

    Requirement check for: Upgrade database structure ...
    Requirement check for: Migrate SysConfig settings ...

        Should the SysConfig be migrated? [Y]es/[N]o: Y


 Executing tasks ...

    Step 1 of 21: Check required Perl version ...
    Step 2 of 21: Check required database version ...
    Step 3 of 21: Check database charset ...
    Step 4 of 21: Check required Perl modules ...
    Step 5 of 21: Check if database has been backed up ...
    Step 6 of 21: Upgrade database structure ...
    Step 7 of 21: Rebuild configuration ...
    Step 8 of 21: Migrate SysConfig settings ...
    Step 9 of 21: Migrate DBCRUD UUID columns ...
        Activity: Column dbcrud_uuid in table activity...
            Column successfully created
        Calendar::Plugin: Column dbcrud_uuid in table calendar_appointment_plugin...
            Column already exists
        OAuth2Token: Column dbcrud_uuid in table oauth2_token...
            Column already exists
        OAuth2TokenConfig: Column dbcrud_uuid in table oauth2_token_config...
            Column already exists
    Step 10 of 21: Migrate dynamic fields ...
    Step 11 of 21: Migrate notification events ...
    Step 12 of 21: Integrate Znuny-NoteToLinkedTicket ...
    Step 13 of 21: Migrate groups ...
    Step 14 of 21: Cleanup orphaned mentions ...
    Step 15 of 21: Uninstall merged packages ...
    Step 16 of 21: Initialize default cron jobs ...
    Copying /opt/znuny/var/cron/aaa_base.dist to /opt/znuny/var/cron/aaa_base...
    done.
    Copying /opt/znuny/var/cron/znuny_daemon.dist to /opt/znuny/var/cron/znuny_daemon...
    done.
    Step 17 of 21: Clean up the cache ...
    Step 18 of 21: Rebuild configuration another time ...
    Step 19 of 21: Deploy ACLs ...
    Step 20 of 21: Deploy processes ...
    Step 21 of 21: Check invalid settings ...



 Migration completed!

znuny@testsystem:~$ bin/otrs.Console.pl Admin::Package::UpgradeAll

There are no installed packages

Done.
znuny@testsystem:~$ exit
logout
testsystem opt # su -c 'bin/Cron.sh start' - znuny
(using /opt/znuny-7.0.12) done
testsystem opt # systemctl start apache2
testsystem opt # systemctl start postfix
testsystem opt # cat /opt/znuny/RELEASE
PRODUCT = Znuny
VERSION = 7.0.12
BUILDDATE = Wed Oct 18 10:33:28 CEST 2023
BUILDHOST = ci-runner-01.znuny.com
COMMIT_ID = a7a99246b7e710b4cf514b2be7bf8a13dd5d6032
testsystem opt # systemctl status apache2.service
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; preset: enabled)
     Active: active (running) since Mon 2023-11-13 16:39:20 CET; 2min 5s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 3578 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 3584 (/usr/sbin/apach)
      Tasks: 12 (limit: 9484)
     Memory: 211.1M
        CPU: 2.113s
     CGroup: /system.slice/apache2.service
             ├─3584 /usr/sbin/apache2 -k start
             ├─3587 /usr/sbin/apache2 -k start
             ├─3588 /usr/sbin/apache2 -k start
             ├─3589 /usr/sbin/apache2 -k start
             ├─3590 /usr/sbin/apache2 -k start
             ├─3591 /usr/sbin/apache2 -k start
             ├─3592 /usr/sbin/apache2 -k start
             ├─3751 /usr/sbin/apache2 -k start
             ├─3795 /usr/sbin/apache2 -k start
             ├─3796 /usr/sbin/apache2 -k start
             ├─3797 /usr/sbin/apache2 -k start
             └─3798 /usr/sbin/apache2 -k start

Nov 13 16:39:19 testsystem systemd[1]: Starting apache2.service - The Apache HTTP Server...
Nov 13 16:39:20 testsystem systemd[1]: Started apache2.service - The Apache HTTP Server.
I can log in to the Znuny system. I can also see tickets. However, my dashboard is buggy and I'm not sure whether other settings are missing.
skullz
Znuny superhero
Posts: 624
Joined: 24 Feb 2012, 03:58
Znuny Version: LTS and Features
Real Name: Mo Azfar
Location: Kuala Lumpur, MY
Contact:

Re: Update Znuny 7.0.12

Post by skullz »

I just assumed you opt for the new user 'znuny' and directory '/opt/znuny'

1. Kernel/Config.pm

Code: Select all

$Self->{Home} = '/opt/znuny';
2. Check for the ScriptAlias, Frontend::WebPath and Ticket::Article::Backend::MIMEBase::ArticleDataDir

Code: Select all

shell > bin/znuny.Console.pl Admin::Config::Read --setting-name ScriptAlias 
shell > bin/znuny.Console.pl Admin::Config::Read --setting-name Frontend::WebPath
shell > bin/znuny.Console.pl Admin::Config::Read --setting-name Ticket::Article::Backend::MIMEBase::ArticleDataDir
If not correct, update it.

Code: Select all

shell > bin/znuny.Console.pl Admin::Config::Update --setting-name ScriptAlias --value znuny/
shell > bin/znuny.Console.pl Admin::Config::Update --setting-name Frontend::WebPath --value /znuny-web/

3. By default, apache2-httpd.include.conf and apache-perl-startup.pl (Znuny 7) already come with znuny directory.
So no need to update anything here.

4. I think your 100-name-ssl.conf may not correct. Check the path .

5. There is bug at dashboard (7.0.12). https://github.com/znuny/Znuny/issues/503

6. Redirect old ticker link request (otrs) to new one (znuny)
https://www.znuny.org/en/blog/detour-with-znuny-7
Manfred89
Znuny newbie
Posts: 53
Joined: 14 Jun 2023, 21:44
Znuny Version: 6.5.8
Real Name: Manfred

Re: Update Znuny 7.0.12

Post by Manfred89 »

I just assumed you opt for the new user 'znuny' and directory '/opt/znuny'
right
1. Kernel/Config.pm

Code: Select all

$Self->{Home} = '/opt/znuny';
1. I only have $Self->{Home} in my Config.pm.

2. and 4. I will check this the next days
By default, apache2-httpd.include.conf and apache-perl-startup.pl (Znuny 7) already come with znuny directory.
So no need to update anything here.
3. ok perfect

5. and 6. Thx for the link
Manfred89
Znuny newbie
Posts: 53
Joined: 14 Jun 2023, 21:44
Znuny Version: 6.5.8
Real Name: Manfred

Re: Update Znuny 7.0.12

Post by Manfred89 »

I just assumed you opt for the new user 'znuny' and directory '/opt/znuny'
  • right, new user and new directory
1. Kernel/Config.pm

Code: Select all
$Self->{Home} = '/opt/znuny';
  • just have $Self->{Home} in Config.pm
2. Check for the ScriptAlias, Frontend::WebPath and Ticket::Article::Backend::MIMEBase::ArticleDataDir

Code: Select all

shell > bin/znuny.Console.pl Admin::Config::Read --setting-name ScriptAlias
shell > bin/znuny.Console.pl Admin::Config::Read --setting-name Frontend::WebPath
shell > bin/znuny.Console.pl Admin::Config::Read --setting-name Ticket::Article::Backend::MIMEBase::ArticleDataDir

If not correct, update it.

Code: Select all

shell > bin/znuny.Console.pl Admin::Config::Update --setting-name ScriptAlias --value znuny/
shell > bin/znuny.Console.pl Admin::Config::Update --setting-name Frontend::WebPath --value /znuny-web/
  • When i update this, i have done alle changes in config.pm or in which files do they will change the values?
3. By default, apache2-httpd.include.conf and apache-perl-startup.pl (Znuny 7) already come with znuny directory.
So no need to update anything here.
  • ok so ignoring this files
4. I think your 100-name-ssl.conf may not correct. Check the path .
  • Which path do you mean?
  • ScriptAlias /otrs/?
  • Alias /otrs-web/?
  • RewriteRule nad Perlrequire should be okay?
5. There is bug at dashboard (7.0.12). https://github.com/znuny/Znuny/issues/503
  • So i will waiting until 7.0.13
6. Redirect old ticker link request (otrs) to new one (znuny)
https://www.znuny.org/en/blog/detour-with-znuny-7

Code: Select all

touch /etc/apache2/conf-available/znuny_extra.conf
	RedirectMatch "/otrs/(.*)" "/znuny/$1"
a2enconf znuny_extra
apache2ctl configtest && systemctl reload apache2.service

So the specifics would be:
1. Create new user Znuny + directory
2. Check 4 variables
  • {Home}
  • {'Frontend::WebPath'}
  • {'ScriptAlias'}
  • {'Ticket::Article::Backend::MIMEBase::ArticleDataDir`}
3. Edit the file 100-name-ssl.conf
4. Forward old otrs tickets to znuny

Anything else except dashboard bug
skullz
Znuny superhero
Posts: 624
Joined: 24 Feb 2012, 03:58
Znuny Version: LTS and Features
Real Name: Mo Azfar
Location: Kuala Lumpur, MY
Contact:

Re: Update Znuny 7.0.12

Post by skullz »

2. No need to touch Config.pm if you using `bin/znuny.Console.pl Admin::Config::Update` except for the $Home path that only available in the Config.om

They will be update in DB and ZZZAuto if not mistaken.

3. I guess this conf for the ssl.
Normally i just use default-ssl conf file that come with the webserver. Just need to add the key and cert.

The path should be

Code: Select all

 
ScriptAlias /znuny/ "/opt/znuny/bin/cgi-bin/"
Alias /znuny-web/ "/opt/znuny/var/httpd/htdocs/"
Post Reply