Remote API don't create database on server

Discussion in 'Developers' Forum' started by desire.levi, Jan 29, 2015.

  1. desire.levi

    desire.levi New Member

    Hello,
    I'm using ispconfig3 3.0.5.4p3 in a multiserver environnement with a web server (web.mydomain.net) a database server (bd.mydomain.net)
    The fact is that when i use the remote api for creatin databases, they aren't created in the database server.

    for creation i do
    $database = array(
    'database_name'=>'howtoshow'
    'server_id'=>3, //database server id
    'type'=>'mysql',
    'database_charset' => 'utf-8',
    'remote_acces'=> 'y',
    'remote_ips'=>'225.225.225.225', //ispconfig3 control panel server ip as in database with GUI database created
    'active'=>'y',
    'backup_interval'=>'monthly',
    'database_ro_user'=>0,
    'database_user_id'=>13,
    'backup_copies'=>1,
    'parent_domain_id'=>243, //a webdomain id
    );
    $answer = $ispconfig3->sites_database_add($session_id, 43, $database); // let's assume the soap is already instanciate
    In $answer, i get the id of the newly created database, i can see it in the GUI too
    but when i connect to bd.mydomain.net, there's no trace of the database. i can see it in the table web_databases of dbispconfig database on bd.mydomain.net but when i list the database on the server. it doesn't appeared.
    I haven't this problem with GUI.
     
    Last edited: Jan 30, 2015
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Compare he database record in the dbispconfig database that you created with the api with one that you created in the ispconfig interface to find the difference.
     
  3. desire.levi

    desire.levi New Member

    I checked the database.
    between an API generated record and an ispconfig's interface one i found four differencies :
    - database_quota, NULL for the first, 0 for the second ;
    - last_quota_notification, NULL for the first, 0000-00-00 for the second;
    - database_name_prefix, nothing for the first, c120_ for the second;
    - parent_domain_id, 0 for the first, a domain id (50) for the second;

    then i try changing certains things, looking the effects in the ispconfig interface and then check in the server if the database have been created :
    - adding the key parent_domain_id with the domain id in the sites_database_add array. in the interface, i now see that my database is linked to a domain, but still not created in the server
    - adding the other key i mentioned above, still nothing.

    What am i missing ??
     
  4. desire.levi

    desire.levi New Member

    It's for a migration from ispcp omega to ispconfig3 so there are many things i can't change
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    But you did all changes trough the api and not directly in the database? You are sure that the server_id is correct, bcause the server will ignore all records where the server_id of the record does not match with the server_id of the target server.
     
  6. desire.levi

    desire.levi New Member

    Yes all changes were made through the api
    the server_id is correct and setted whith the id of my database server ; it's the same than whith the GUI created databases.
     

Share This Page