Problem with Toec Client export
-
Hi, my issue is most probably a result of database move. I had the server configured and working on a test workstation and once I decided to move it to a proper server, in order to save the configuration, and after having the server installed there and configured, I have moved the database from the old machine (backup/restore). Everything seems to be working and the Provision/VerifyDb Toec-API Test responds with 60. However when I export a Toec Client, I get a very small .msi file (2KB) and it can't install (err 'this installation package could not be opened...').
I have went through the config steps again (https://docs.theopenem.com/latest/#/installation/server-installation?id=configure-theopenem) and now on the 'Set Provision Key And Imaging Token', after I generate the key and token and click 'Update', I get 'Could Not Update Settings' message. The other difference with my working test machine that I have noticed, is that on the 'Toec' screen, 'Client MSI Arguments', SERVER_KEY= is empty, while on the test machine it has a value.Application log says:
2023-03-23 18:10:48,796 [130] ERROR Toems_Service.EncryptionServices Could Not Decrypt Password. Ensure Your Encryption Key is Correct.
2023-03-23 18:10:48,827 [130] ERROR Toems_Service.ServiceMsiUpdater Could Not Create Msi.
2023-03-23 18:10:48,842 [130] ERROR Toems_Service.ServiceMsiUpdater Function failed during execution.Is there a way to make it work or should I drop the database and go for full reinstall?
Thank you! -
when you moved the database, did you update the dbencryption key on the new server to match the old one in web.config?
-
No I wasn't aware I had to. Thank you.
I will have it updated and I will repeat the entire process. Is there anything else I should be paying attention to? Previously I have noticed the old machine IP carried over in the com server and cluster, so I have deleted those and re-created them. Anything else you can think of? -
Thanks for your help. This step-by-step process has done the database move successfully for me (moving to different machine/IP with same OS, same installation path, same DB provider):
ON THE SOURCE MACHINE:
- Stop IIS
- Dump theopenem database.
- Save the Toems-API\Web.config DbEncryptionKey
- Copy the database dump to the destination machine
- Restart IIS or leave down if not going to use anymore
ON THE DESTINATION MACHINE:
- Install and configure Theopenem server to make sure its working
- Open the source machine database dump in text editor and replace the source machine IP address with the destination machine IP. Save.
- Stop IIS
- Restore theopenem database dump.
- Replace the DbEncryptionKey in Toems-API\Web.config and Toec-API\Web.config with the one from the source machine (step 3)
- Restart IIS
- Update Toec-API\Web.config ComServerUniqueId with the one from Admin\Client Com Servers
- Delete the old Toems CA and Toems Intermediate certificates if existing
- Export and Install Certificates from the current database.
On the previously connected computers, deinstalling the old server' exported Toec client and reinstalling the one from the new server caused successful inventory refresh on next checkin.
-
@chavi and @theopenem_admin Hi
I would like to try this procedure to change to a newer server.
But without having to reinstall the client on the workstations.
Many of my workstations are outside the network.
Maybe an idea
Thanks -
@cycy Well, technically it should work, but to be fair I haven't tested it. As part of this procedure, the certificates are re-generated from the old installation, I assume you are going to keep the same server IP address (unlike what I do in step 2) and unless there's something else bound within the Toec client from the old machine other than that, the clients should be able to connect as the IP address is the same. If the IP address is different, there's no way for the old client installations to connect. @theopenem_admin may have more to say here.
-
You must not regenerate certificates or nothing will be able to checkin. They will automatically work with the old ones since they are embedded in the database, just need to reinstall the CA and INT on the server. Correct that you can't change IP. Ideally you should be using a FQDN so you don't need to worry about IPs changing.
-
@theopenem_admin Thank you for your reply.
I have followed the steps but in ClientApi.log I have the following error:
2024-07-01 15:49:21,490 [9] ERROR Toems_Service.Entity.ServiceCertificate Could Not Validate Certificate: CN=24cd4c16-8bab-4e21-9ff7-dda7531a4df7, O=Casa Corp
2024-07-01 15:49:21,490 [9] ERROR Toems_Service.Entity.ServiceCertificate Could not find the required object. -
Did install the certs on the new server?
-
@theopenem_admin Yes, I have exported the certificates from my old server.
And I installed them on the new server which has the same name and ip address. -
I would just export them from the web interface like a typical install.
-
This is what I'm doing at step 9.
-
@chavi and @theopenem_admin Hi,
If I export from the Web UI of the new server.
It generates a bad certificate.
So I imported the certificates from the old server.
Certificate.txt -
Difficult to say, guessing database didn't export or import correctly or dbencryption key is wrong.
-
@theopenem_admin
I recovered the dbencryption key from the old server.
And for the database dump I used the following parameters:
--events --routines --triggers
And I also retrieved the ComServerUniqueId of the old server. -
@chavi and @theopenem_admin I forgot to specify when importing on the new server, I got the error set --binary-mode to 1 and to solve the problem I saved the sql file in utf8.
Maybe that's the problem - any ideas? -
In my case, I haven't used any extra mysql dump or restore parameters, simply the shortest possible commands:
mysqldump -u root -p theopenem > theopenem_dump.sql mysql -u root -p theopenem < theopenem_dump.sql
The dump created this way is UTF8 by default. And it worked without issues.
-
@chavi Thank you Chavi for your reply.
I successfully installed my config on my new server.
The problem was the mysql export.