Mysql Dump 1.2 released

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
mahjong

Mysql Dump 1.2 released

Post by mahjong »

Mysql Dump 1.2, with automated locator of MySQL binaries
  • Backup with 'myslqldump'
  • Restore with 'mysql'
  • Backups can be erased
  • GUI with Tango icons
  • Help message on first run
  • Beautified source code
  • Greatly improved locator
  • Help messages on install
  • Stable on CMSMS 1.0
NEW:
  • Takes into account the database prefix set in CMSMS's config file. (thanks to Der Rudi)
    Useful if CMSMS tables coexists with other tables in the same database.
  • Configuration switches hardcoded in MysqlDump.module.php
Mysql Dump is an interface for the 'mysqldump' backup tool. It can be used to dump the CMSMS database for backup or for transferring the data to another server (not necessarily a MySQL server).

In other words, it allows you to dump the contents of your CMSMS database into a text file, and restore from such a file. This text file can be easily saved locally or sent to remote server.

THIS MODULE IS VERY POWERFUL. PLEASE TEST IN A SAFE ENVIRONMENT AND MAKE BACKUPS OF YOUR ALL DATABASES *BEFORE* LEARNING HOW TO USE MYSQL DUMP.
mahjong

Re: Mysql Dump 1.2 released

Post by mahjong »

Discussion about Mysql Dump 1.2 began there.
Oliver
Forum Members
Forum Members
Posts: 28
Joined: Wed Mar 15, 2006 9:50 pm
Location: Switzerland

Re: Mysql Dump 1.2 released

Post by Oliver »

Hi mahjong,

Mysql Dump 1.1 beta runs perfectly on my 1.0-beta6 test install. A very usefull tool - thank you very much!

I have a somewhat related question -  allthough I do not expect this feature from Mysql Dump itself:

Can somebody advise me on a script (bash, perl, php, python) that I could link to a cron table and would allow to restore the database of CMSmadesimple every hour or so on a demo site where I can provide users a sandbox to play around? I suspect mahjong to be the perfect expert on that question  ;)

Thanks a lot

Oliver
mahjong

Re: Mysql Dump 1.2 released

Post by mahjong »

  • Do a restore with the Mysql Dump module to have an idea what the restore command should look like
  • Copy the mysql command and replace ###### with your username/password
  • Add it to the cron table (crontab) preceded with 01 * * * * , which will execute the command hourly (on the 01 minute of each hour)
For instance,

Code: Select all

$ crontab -e

Code: Select all

01 * * * * mysql --user=username --password=yourpassword --default-character-set=latin1 cms < reset_demo.sql
Last edited by mahjong on Fri Sep 08, 2006 6:35 pm, edited 1 time in total.
Oliver
Forum Members
Forum Members
Posts: 28
Joined: Wed Mar 15, 2006 9:50 pm
Location: Switzerland

Re: Mysql Dump 1.2 released

Post by Oliver »

Thanks mahjong that's easier than I'd have expected, its working fine. Is there an equally easy way to automatically clear the cash?
mahjong

Re: Mysql Dump 1.2 released

Post by mahjong »

Is there an equally easy way to automatically clear the cash?
Yes, send me all your money.  :P

cash = argent comptant
cache = mémoire tampon

Seriously, use the thr rm command with the -f switch
Oliver
Forum Members
Forum Members
Posts: 28
Joined: Wed Mar 15, 2006 9:50 pm
Location: Switzerland

Re: Mysql Dump 1.2 released

Post by Oliver »

Yes, send me all your money. 
Taking into account that there are currently no more than 85 cents of cash in my pocket this might be a formidable option  ;)

Concerning the rm command - I'm not familiar with CMSmadesimple's caching- (nor its cashing...) mechanism: which directory would I have to apply it to?
mahjong

Re: Mysql Dump 1.2 released

Post by mahjong »

tmp/cache
tmp/templates_c(ache)
Der Rudi
Forum Members
Forum Members
Posts: 56
Joined: Wed May 17, 2006 7:42 pm

Re: Mysql Dump 1.2 released

Post by Der Rudi »

According to php manual:

Note: mysql_real_escape_string() does not escape % and _. These are wildcards in MySQL if combined with LIKE, GRANT, or REVOKE.

So, in my case (as I am using '_' in table names) the code needs a bit tweaking:

replace

Code: Select all

$tb_prfx = mysql_real_escape_string($config['db_prefix']); 


with

Code: Select all

$tb_prfx = mysql_real_escape_string($config['db_prefix']); 
$tb_prfx = str_replace("_", "\_", $tb_prfx); //escape special character '_'
mahjong

Re: Mysql Dump 1.2 released

Post by mahjong »

Thanks.

Better make it :

Code: Select all

$tb_prfx = addcslashes(mysql_real_escape_string($config['db_prefix']), "%_");
I'll release the patch as soon as I have free time.
Last edited by mahjong on Wed Sep 13, 2006 5:46 am, edited 1 time in total.
MichaelK

Re: Mysql Dump 1.2 released

Post by MichaelK »

Warning:  system() has been disabled for security reasons in /home/****/public_html/modules/MysqlDump/MysqlDump.module.php on line 442

Warning:  system() has been disabled for security reasons in /home/michael/domains/****/public_html/modules/MysqlDump/MysqlDump.module.php on line 443
-- WARNING : Please, check permissions of files and folders :
--      chmod 777 admin/backups
--      chmod 777 modules/MysqlDump
--      chmod 666 modules/MysqlDump/dump-verbose.txt


I get this error.
When I look at my server dump-verbose.txt is not 666 but 600. I can't manually edit this to 666.
Is this maybe the problem of my problem?
mahjong

Re: Mysql Dump 1.2 released

Post by mahjong »

Warning:  system() has been disabled for security reasons
On your server, the administrator doesn't allow the use of system commands triggered by PHP. Therefore, you cannot use Mysql Dump. There is nothing you can do. You'll have to find another way to back up your database. Maybe, phpMyAdmin. Ask your administrator.
Last edited by mahjong on Thu Sep 14, 2006 5:41 am, edited 1 time in total.
Piratos

Re: Mysql Dump 1.2 released

Post by Piratos »

Get my Class PiDatabase from my website.

There are 3 functions you can easy rewrite as a cmsms module

1. Backup
2. restore
3. Optimize



Backup and Restore are fully compatble with PhpMyAdmin (you can make Backup with the class function  and Restore with PhpMyAdmin, or make Backup with Phpmyadmin and restore with the function or you can backup and restore with the function itself).

No need of Mysqldump or systemprograms.
mahjong

Re: Mysql Dump 1.2 released

Post by mahjong »

Piratos wrote:Get my Class PiDatabase from my website.
Thank you for your contribution. I'll will be integrated into the next generation of Mysql Dump.
Last edited by mahjong on Thu Sep 14, 2006 2:26 pm, edited 1 time in total.
websherpa

Re: Mysql Dump 1.2 released

Post by websherpa »

Problem accessing database.

On my system we use a separate host name to access the database (and CMSMADESIMPLE accommodates this nicely), but when I try to use MySQL Dump (which I would love to), it can't find the database because it tries to connect to it on localhost instead.  Any ideas for how to moduify it to tease the location out of CMSMS?  or other (polite) suggestions? :-)

thank you.
Locked

Return to “Modules/Add-Ons”