CodeIgniter Forums

Full Version: Unsupported feature of the database platform you are using.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
As showing the error, CI4 does not have the method.

See https://codeigniter4.github.io/CodeIgnit...ities.html
Thanks a lot Big Grin Big Grin