Welcome Guest, Not a member yet? Register   Sign In
Poll: Do you use the database backup feature?
You do not have permission to vote in this poll.
Yes
40.86%
38 40.86%
No
59.14%
55 59.14%
Total 93 vote(s) 100%
* You voted for this item. [Show Results]

How often do you use the backup() method of the database drivers?
#27
Smile 

(02-06-2019, 09:50 PM)kilishan Wrote: The Mysql driver in CodeIgniter (I think that's the only one) has a backup feature. Do you ever use this feature? Thinking of dropping it from CI4.

me, using till now, my client and I need to take backup manually every week, 
sometimes we use it in crone and push to our cloud, its really a helpful feature for me and my team Smile 

     
Code:
       $this->load->helper('url');
        $this->load->helper('file');
        $this->load->helper('download');
        $this->load->library('zip');
        $this->load->dbutil();
        $db_format = array('format' => 'zip', 'filename' => 'my_db_backup.sql');
        $backup = &$this->dbutil->backup($db_format);
        $dbname = 'backup-on-' . date('Y-m-d') . '.zip';
        $save = 'backup/' . $dbname;
        write_file($save, $backup);
        force_download($dbname, $backup);
Heart Heart Heart Heart Heart
Reply


Messages In This Thread
RE: How often do you use the backup() method of the database drivers? - by jijin - 02-21-2019, 11:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB