database backup like phpMyAdmin |
[eluser]skunkbad[/eluser]
Maybe I haven't looked in the right place, or just haven't found what I am looking for. I'd like to have complete database backup made in standard sql format. Click a button, download the sql file. Yes, I could do this in phpMyAdmin, but I want the other users (the site owners) to be able to do their own backups. I saw a solution that uses SELECT into $filename, and wondering if this is the best way to get started.
[eluser]Burak Guzel[/eluser]
You can run shell commands with the PHP shell_exec() function, which you can use to call mysqldump http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
[eluser]eoinmcg[/eluser]
buried deep in the user guide is this little gem: http://ellislab.com/codeigniter/user-gui...tml#backup
[eluser]skunkbad[/eluser]
[quote author="eoinmcg" date="1277464683"]buried deep in the user guide is this little gem: http://ellislab.com/codeigniter/user-gui...tml#backup[/quote] Actually just found that, and it works, but not great. The reason why I say that is that it creates an individual insert for every row of a table, where phpMyAdmin groups rows together for a way smaller backup file. I guess its better nothing...
[eluser]skunkbad[/eluser]
[quote author="skunkbad" date="1277465334"][quote author="eoinmcg" date="1277464683"]buried deep in the user guide is this little gem: http://ellislab.com/codeigniter/user-gui...tml#backup[/quote] Actually just found that, and it works, but not great. The reason why I say that is that it creates an individual insert for every row of a table, where phpMyAdmin groups rows together for a way smaller backup file. I guess its better nothing...[/quote] I ended up fixing the _backup function inside mysql_utility.php, and the inserts are the way I want them: Code: // --------------------------------------------------------------------
[eluser]elambiguo[/eluser]
Do not know if it will serve you .... I use an external application free to manage the database, efficient and simple to use .... http://www.mysqldumper.net/
[eluser]cahva[/eluser]
Why not use mysqldump command straight from server using exec command? No timeout and memory limit limitations.. EDIT: damn. Somehow missed Burak Guzel advice(as did everybody else seems) ![]()
[eluser]skunkbad[/eluser]
[quote author="cahva" date="1277484417"]Why not use mysqldump command straight from server using exec command? No timeout and memory limit limitations.. EDIT: damn. Somehow missed Burak Guzel advice(as did everybody else seems) ![]() Not everyone, like shared hosting customers, will have access to exec. I came up with an easy solution, and it is built into CI. I extended the database utility class. I understand that the CI backup may not work for some larger databases. I've been working on a solution to try to make the backup better. |
Welcome Guest, Not a member yet? Register Sign In |