ADMIN permissions gone after reimporting backups

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

ADMIN permissions gone after reimporting backups

Postby ConnectedDialer » Fri May 03, 2019 11:24 am

After running the the script that restores vicidial backups (the recommended restore srcipt, I can pot it if you'd like) I see that all the data has been restored. Mysql data is there and so is all the admin/user info and permissions in the admin user record are identical to what they were in the backed up version. But somehow I'm seeing that admin has almost no permissions when I log in as him into the admin web interface. This is the default 6666 user. Other than the records in mysql, where else could the restore script fail to update some data/parameter that would cause this?
Vicibox 8.0.1 from .iso
VICIDIAL: 2.14-644a BUILD: 171130-0036
Asterisk 11.25.3-vici
Single Server
No Digium/Sangoma Hardware
No Extra Software After Installation
Custom PC - XEON E5-1607
ConnectedDialer
 
Posts: 52
Joined: Wed Jun 06, 2018 11:14 am

Re: ADMIN permissions gone after reimporting backups

Postby williamconley » Fri May 03, 2019 12:16 pm

1) Great job posting your specs.

2) There is no (of which I am aware) "Recommended restore script". Thus a link to whatever script you used would be useful.

3) Since we don't know what you restored, the desciption you've given likely means you no longer have matching Vicidial Scripts to the Database Schema Version presently installed. If the fields do not match precisely, oddly irregular behavior (often including missing data) is quite common.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: ADMIN permissions gone after reimporting backups

Postby ConnectedDialer » Fri May 03, 2019 3:22 pm

Thank you William, I think you are right. One of the fields that admin.php is looking for does not appear to be in the vicidial_users table, which leads me to believe I have installed a different version of vicibox than the original where the backup was done.

What is the best way to determine the vicibox version on already installed machine if I no longer have the disk I used before? (I only have my signature as reference now :) Don't recall where I collected the versions)

By the way, this is the script I use to restore backup on secondary server daily: (variables in {{ }} are for ansible and are properly replace before running the scipt)

Code: Select all
#!/bin/bash

DOW=$(/usr/bin/date +%u)

((DOW--))

echo Restoring weekday: $DOW

ALLF={{ hostvars[original_host_alias]['ansible_host']}}_ALL_$DOW.tar.gz

cd /var/log/astguiclient/archive/

/bin/tar xvfz $ALLF

/usr/bin/mv /var/log/astguiclient/archive/var/log/astguiclient/archive/temp/{{ hostvars[original_host_alias]['ansible_host']}}* /

cd /

/usr/bin/rm -rf /var/log/astguiclient/archive/var/

/bin/tar xvf /{{ hostvars[original_host_alias]['ansible_host']}}_VOICEMAIL_$DOW.tar
/bin/tar xvf /{{ hostvars[original_host_alias]['ansible_host']}}_CONF_$DOW.tar
/bin/tar xvf /{{ hostvars[original_host_alias]['ansible_host']}}_BIN_$DOW.tar
/bin/tar xvf /{{ hostvars[original_host_alias]['ansible_host']}}_LINUX_$DOW.tar
/bin/tar xvf /{{ hostvars[original_host_alias]['ansible_host']}}_SOUNDS_$DOW.tar

/usr/bin/gunzip -f /{{ hostvars[original_host_alias]['ansible_host']}}asterisk$DOW.gz

/usr/bin/mysql -uroot asterisk < /{{ hostvars[original_host_alias]['ansible_host']}}asterisk$DOW

rm -rf /{{ hostvars[original_host_alias]['ansible_host']}}*

/usr/bin/sed -i 's/{{ backup_host_external_ip }}/{{ restore_host_external_ip }}/g' /etc/asterisk/sip.conf

# update ip address
/usr/bin/perl /usr/share/astguiclient/ADMIN_update_server_ip.pl --old-server_ip={{ hostvars[original_host_alias]['ansible_host']}} --server_ip={{ hostvars[restore_host_alias]['ansible_host']}} --auto

# update carrier data
/usr/bin/mysql -uroot <<EOF
UPDATE asterisk.vicidial_server_carriers SET account_entry = "[twac]
type=peer
secret={{ tw_secret }}
username={{ tw_user }}
host={{ pstn_host }}
dtmfmode=rfc2833
canreinvite=no
disallow=all
allow=ulaw
insecure=port,invite
fromuser={{ tw_fromuser }}
fromdomain={{ pstn_host }}
context=trunkinbound-dynamic"
where carrier_id = 'TW1';
EOF

# update system settings
/usr/bin/mysql -uroot <<EOF
UPDATE asterisk.system_settings SET sounds_web_server = '{{ hostvars[restore_host_alias]['ansible_host']}}';
UPDATE asterisk.system_settings SET active_voicemail_server = '{{ hostvars[restore_host_alias]['ansible_host']}}';
UPDATE asterisk.servers SET external_server_ip = '{{ restore_host_external_ip }}' WHERE server_id = 'vicibox8';
EOF

# Reload asterisk
/usr/sbin/asterisk -x reload

Vicibox 8.0.1 from .iso
VICIDIAL: 2.14-644a BUILD: 171130-0036
Asterisk 11.25.3-vici
Single Server
No Digium/Sangoma Hardware
No Extra Software After Installation
Custom PC - XEON E5-1607
ConnectedDialer
 
Posts: 52
Joined: Wed Jun 06, 2018 11:14 am

Re: ADMIN permissions gone after reimporting backups

Postby williamconley » Fri May 03, 2019 4:16 pm

Let me clear up some misunderstandings for you:

1) Vicibox is the installer. It does not determine the version of Vicidial, except that (by default) it will install the latest version of Vicidial available at the moment of the install. This applies to all versions of Vicibox. If you install Vicibox 3.0.4, it will still install the Latest version of Vicidial available.

2) You have two choices ...
* Install the same version of Vicidial on your server that you had previously. This can be done by matching the Vicidial version available from the system settings OR the SVN revision level from the system settings (and hope it's right).
* (RECOMMENDED): Find the DB schema in the system settings (look directly in the mysql table vicidial_system_settings if the system settings in the GUI does not display the DB Schema). Then use the instructions in /usr/src/astguiclient/trunk/UPGRADE to upgrade JUST the DB to match your installed Vicidial scripts. This will give you the added bonus of an upgrade and also guarantee that the version of Asterisk installed by the Vicibox installer will work (which is not guaranteed if you downgrade Vicidial to match your database schema, it may be too old to work with Asterisk 13).
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: ADMIN permissions gone after reimporting backups

Postby ConnectedDialer » Mon May 06, 2019 9:43 am

If I had to go with the option of installing the same version as on my original server without upgrading, where can I find details on installing the specific vicidial version (without vicibox installer) and where would I download it from? I know I can get the svn revision number and probably check out that revision, but what else do I need to do? Where would be the DB schema? What other scripts/files would I need?
Vicibox 8.0.1 from .iso
VICIDIAL: 2.14-644a BUILD: 171130-0036
Asterisk 11.25.3-vici
Single Server
No Digium/Sangoma Hardware
No Extra Software After Installation
Custom PC - XEON E5-1607
ConnectedDialer
 
Posts: 52
Joined: Wed Jun 06, 2018 11:14 am

Re: ADMIN permissions gone after reimporting backups

Postby Acidshock » Mon May 06, 2019 2:00 pm

Care to share your ansible deployment scripting? :D
VERSION: 2.14-698a | BUILD: 190207-2301 | Asterisk:13.24.1-vici | Vicibox 8.1.2
Acidshock
 
Posts: 430
Joined: Wed Mar 03, 2010 3:19 pm

Re: ADMIN permissions gone after reimporting backups

Postby ConnectedDialer » Tue May 07, 2019 3:34 pm

Care to share your ansible deployment scripting?


I posted the script above, there's not much else to it.

So I tried to simply change the version of codebase via SVN, and either I'm not doing something right or not doing enough:

Code: Select all
cd /usr/src/astguiclient/trunk/
svn update -r 2872


This set the codebase to match the revision in the backup, but what's next?

What script do I need to run to deploy?
Vicibox 8.0.1 from .iso
VICIDIAL: 2.14-644a BUILD: 171130-0036
Asterisk 11.25.3-vici
Single Server
No Digium/Sangoma Hardware
No Extra Software After Installation
Custom PC - XEON E5-1607
ConnectedDialer
 
Posts: 52
Joined: Wed Jun 06, 2018 11:14 am

Re: ADMIN permissions gone after reimporting backups

Postby williamconley » Wed May 08, 2019 3:53 pm

Code: Select all
perl install.pl --help
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: ADMIN permissions gone after reimporting backups

Postby ConnectedDialer » Thu May 09, 2019 10:44 am

Thank you William
Vicibox 8.0.1 from .iso
VICIDIAL: 2.14-644a BUILD: 171130-0036
Asterisk 11.25.3-vici
Single Server
No Digium/Sangoma Hardware
No Extra Software After Installation
Custom PC - XEON E5-1607
ConnectedDialer
 
Posts: 52
Joined: Wed Jun 06, 2018 11:14 am


Return to Support

Who is online

Users browsing this forum: No registered users and 49 guests