OpenEMR on Azure - install error

Hi there

I’ve been following this article to deploy OpenEMR on Azure, using the latest version 7.0.0 downloaded from the OpenEMR website.

Deploying OpenEMR on Azure - Microsoft Community Hub

When I run the command in step 22, it executes but then returns the following error.

[03-Oct-2023 00:31:42 UTC] PHP Fatal error: Uncaught mysqli_sql_exception: Failed to generate invisible primary key. Auto-increment column already exists. in /home/site/wwwroot/library/classes/Installer.class.php:1288
Stack trace:
#0 /home/site/wwwroot/library/classes/Installer.class.php(1288): mysqli_query(Object(mysqli), ‘CREATE TABLE a...') #1 /home/site/wwwroot/library/classes/Installer.class.php(325): Installer->execute_sql('CREATE TABLE a…’)
#2 /home/site/wwwroot/library/classes/Installer.class.php(273): Installer->load_file(’/home/site/wwwr…’, ‘Main’)
#3 /home/site/wwwroot/library/classes/Installer.class.php(1217): Installer->load_dumpfiles()
#4 /home/site/wwwroot/contrib/util/installScripts/InstallerAuto.php(127): Installer->quick_install()
#5 {main}
thrown in /home/site/wwwroot/library/classes/Installer.class.php on line 1288

I cannot see from the stack trace how to fix the issue and successfully re-run the installer script. Any advice gratefully received.

Cheers
Mark

Mark,

It appears that you’ve encountered an issue related to an existing auto-increment column in your database, as indicated by the error message. To address this problem, I would recommend trying the following steps:

Try a Clean Database:

  1. Backup Your Current Database: Before proceeding, ensure that you have a backup of your existing database to safeguard your data.
  2. Access Your Azure Database: Log in to your Azure portal and locate your database resource.
  3. Delete the Existing Database:
  • In the Azure portal, navigate to your database resource.
  • Under the “Settings” section, click on “Databases.”
  • Select the database causing the issue.
  • Click on the “Delete” button and follow the prompts to confirm the deletion.
  1. Create a New Database:
  • After deleting the database, you can create a new one to start with a clean slate. This can also be done through the Azure portal.
  • Go to your Azure portal and navigate to your Azure Database resource.
  • Under “Settings,” click on “Databases.”
  • Click on the “+ Add” button to create a new database.
  • Follow the steps to configure your new database, including specifying a name, server, and other settings as required.
  1. Update OpenEMR Configuration: After creating the new database, ensure that you update your OpenEMR configuration to use the new database credentials (database name, username, password, etc.) that you specified during the database creation process.
  2. Re-run the Installation: With the updated database configuration, attempt to re-run the OpenEMR installation process.

This should provide you with a fresh database to work with, which may resolve the issue related to the existing auto-increment column. Make sure to consult the official OpenEMR documentation and Azure documentation for specific guidance related to your deployment.

Remember to keep backups of your data throughout the process and thoroughly test your setup to ensure it’s functioning as expected.

Best of luck with your OpenEMR deployment on Azure, and if you have any more questions or encounter any issues, feel free to ask for further assistance.

Cheers,