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
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.
where it's the menu
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?
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
how to change the layout to see the menu?
public function actionIndex()
nothing changed? How you did it?
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 have solved this in my 1.1 update.
Just to say thank you.
Hey. I was looking for ideas to implement a backup system on my current project. Thanks for this extension.
Very nice work...good extension....
Added modified date time
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...
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.
Ya. Agree. I wish i do that soon.
recommend switching actionRestore
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.
Thanks @skworden ,
I happy to hear that. I shall pick your changes for next release planned in next week.
Table named "leave" causing error!
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: 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
this extension is very useful for me to manged dabase
it save more time
Thanks for reporting. I would fix that soon.
I have updated extension with fix for your problem. More changes are under testing and I shall release more features soon.
remote file disclosure
The extension allows to download files from outside 'path' folder...
Thanks for reporting. I have fixed this bug.
I found a small inconsistency in the _list.php file.
The download and restore links are listed with lower case letters in the template, but is capitalized in the column definition. Therefor the links do not work.
Thanks, I shall fix it in next release.
[SOLVED] (Problem with Nested Module) Cannot Delete, Download, & Restore Backup File
Everything was fine when I installed the module in /protected/modules/
but Delete, Download & Restore went wrong when I nested Module it.
How do I get around this? anyone? thanks.
To those of you encountering such problem, here's how I solved it.
Just modify the following
that's basically how I've solved my problem.
error :( use mssql :(
sp_create_table error use mssql, help me dude ....
SQLSTATE: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Could not find stored procedure 'sp_create_table'..
Error 500 Undefined index: Create Table
when I click on the create backup file it shows the error
but also create the file.
nice and greate extension but little problem Error 404 Unable to resolve the request "backup/site/index".
the link backup/site/index is working fine but when I click on another link i.e on my dashboard link it gives the error
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.