First of all, I'm having a very hard time understanding Bluetooth because all Arduino oriented guides and tutorial are pretty basic.
I have a clone HM-10 board wired to an Arduino. I've read it's "backwards compatible", but maybe I got it wrong, because I want to connect it to an ESP32 which works under Bluetooth Serial. I have a program coded in the ESP32 that received serial commands from an Android App and controlled some motors and lights. And now I want to send the commands from the Arduino.
I can use my phone to scan and pair with my ESP32, but I have no clue on how to code the Arduino to do exactly that switch.
Do I need a different module? Is it only possible through BLE? If so, the ESP should be a master, a server? Can anyone point me in the right direction?
The HM 10 board is a BLE module and it won't communicate with the ESP32 using BluetoothSerial.h like you do with the phone.
To continue with classic bluetooth like you are using with the phone, you would do better to switch to an HC05.
I would not recommend switching to BLE just in order to use the module you have in hand. The HM10 is not a fully configured BLE module and many have had difficulty using it to connect to something other than an iphone.
Either the ESP32 or the HC05 will need to be the master to make the connection. The ESP32 BluetoothSerial example SerialToSerialBTM shows how to make the esp into a master.