CodeIgniter Forums
Unsupported feature of the database platform you are using. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Unsupported feature of the database platform you are using. (/showthread.php?tid=78667)



Unsupported feature of the database platform you are using. - masanabdiwicaksono - 02-22-2021

Hi,

How to use backup function in codeigniter 4, i am using method from codeigniter 3 and it won't work.

Showing Error : CodeIgniter\Database\Exceptions\DatabaseException Unsupported feature of the database platform you are using.


Code:
public function backup()
    {
        $model = new class extends \CodeIgniter\Model
        {
            protected $table      = 'tb_envelope';
            protected $primaryKey = 'id_envelope';
        };
        $db = \Closure::bind(function ($model) {
            return $model->db;
        }, null, $model)($model);

        $util = (new \CodeIgniter\Database\Database())->loadUtils($db);

        $date= date('YmdS-His');

        $config = [
            'format' => 'zip',
            'filename' => 'My_' . $date . '_db.sql',
            'add_drop' => TRUE,
            'add_insert' => TRUE,
            'newline' => "\n",
            'foreign_key_checks' => FALSE,
        ];

        $backup = $util->backup($config);
        $file_name= 'My_' . $tanggal . '.zip';
        helper('download');
        $this->response->download($file_name, $backup);

Thank You Big Grin


RE: Unsupported feature of the database platform you are using. - kenjis - 02-22-2021

As showing the error, CI4 does not have the method.

See https://codeigniter4.github.io/CodeIgniter4/database/utilities.html


RE: Unsupported feature of the database platform you are using. - InsiteFX - 02-23-2021

You can manually do it.

Backup/Restore MySql database using PHP


RE: Unsupported feature of the database platform you are using. - masanabdiwicaksono - 02-23-2021

Thanks a lot Big Grin Big Grin