This is a simple module for full database Backup/Restore. I have been using it for all my apps for quite sometime now. It saves lot of time.
I have enabled basic access control so you can use it on live websites.
Yii 1.1 or above)
unzip the attached code under /protected/modules/
Add following code in config main.php under modules
'backup',
You can specify custom path for backup files.
'backup'=> array('path' => __DIR__.'/../_backup/' ),
Thats it , now you can open your web app with ?r=backup or /backup appended to home url.
Total 18 comments
Thanks for reporting. I have fixed this bug.
Regards, Shiv
Hi. The extension allows to download files from outside 'path' folder... Example: http://myapp/backup/default/download?file=../config/main.php
Possible Fix:
I have updated extension with fix for your problem. More changes are under testing and I shall release more features soon.
Thanks for reporting. I would fix that soon.
Thanks, Shiv
this extension is very useful for me to manged dabase it save more time thanks you.
Hello, I have a table named "leave" which is causing an error since it is a reserved keyword! Have you cater for this plz? Anyone can help? Thanks!
PS: Error is as follows: CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave' at line 1. The SQL statement executed was: SHOW CREATE TABLE leave
Thanks @skworden ,
I happy to hear that. I shall pick your changes for next release planned in next week.
Thanks, Shiv
I really like this and have made tons of modification to your extension. Here is one that you might want to put on the next update.
It if the user selects a file from the list of backups it will restore that one.
If they use your button/menu link to restore a backup it will get the last .sql file uploaded file in the directory and restore that one (based on create time). If no .sql files exist then it will return no files exist.
Also, it does not redirect them to the update page it just displays a flash message in the index saying it was uploaded.
index
Ya. Agree. I wish i do that soon.
I think it would be nice if on action clean it didn't wipe the main super user. I was playing around with it and I couldn't log back in so I had to restore a backup manually which defeats the whole purpose of cleaning it.
in controller actionIndex()
I added the following:
NOTE: I change my date format make sure create_time and modified_time are in the same date format.
and in the index.php I added
All it does it gets the last modified time from the file and displays it...
Very nice work...good extension....
Hey. I was looking for ideas to implement a backup system on my current project. Thanks for this extension.
I have solved this in my 1.1 update.
Thanks, Shiv
I did exactly the same thing:
Of course, you must have a column2 layout file located in protected/views/layouts, and this view must include a zii.widgets.CMenu using $this->menu to initialize 'items'.
I did nothing else ...
I've tried
public function actionIndex() { $this->layout='//layouts/column2';
nothing changed? How you did it?
I had the same problem, and I changed the DefaultController layout to column2 to see the menu.
Regarding security, I found no access check neither
I install it in an empty project. I can see the "Manage database backup files" with an empty table bellow, no menu, action or anything.
When I browse to backup/default/create it did create the SQL file, witch is good, but probably I should have a button/link for this?
Also I don't see any security for it, I can see the page without being log-in, it's there any or can be added?
Leave a comment
Please login to leave your comment.