Our thinking


Change 3CX System Owner via ssh on v20

I recently took on a new client and in the process migrated their 3CX instance onto a new host as part of their onboarding process.

In doing this, I took a backup of the previous system, spun up a new instance in Lightsail and imported the backup.

As it turns out however, the previous version was still on v18, and logging in with the username ‘admin’. I had the password for this user so thought everything was good, however for v20 I didn’t have the password for the admin user on extension 100.

I only realised this after I had already deployed the new system from a backup, and it cut over the FQDN, so it cut off my access to the old system on v18.

Fortunately I found some details on how to change the admin user email address (but not the password) over on reddit.

Comment
byu/Ok-Stu from discussion
in3CX
Just in case this post vanishes in the future however, the instructions are:

Log into the new instance via ssh.

Elevate your login session to root, and then change to the Postgres user

sudo -s
su - postgres

Connect to 3CX and load the database – called database_single:

psql
\c database_single

Find the record with the current system owner’s email address and replace it with your email:

database_single=# UPDATE voicemail
SET email = '[email protected]'
WHERE email = '[email protected]';

Then quit psql and exit the shell as the Postgres user

\q
exit

Lastly, reboot the VM to force the new database to be reloaded.

reboot

And you’re done. Once it’s back up again, at the login window, use the password reset with your email address.

Leave a Reply