Sunteți pe pagina 1din 6

STORE SIGN IN

EllisLab

Forum Home Community Gathering The Lounge Thread

Search in all forums

SEARCH

Advanced Search

Backing up MAMP Pro


stinhambo

Posted: 24 November 2008 10:33 PM

Hi all,
Im trying to backup mySQL databases (MAMP Pro) on the Mac but the only way seems to be to go into phpMyAdmin and
Joined: 2007-01-05
1266 posts

export each one individually.


Is there a way of just backing up a folder(s) that contains all this stuff including program settings?
I cant find any details on the MAMP forums.
Signature

Steven Hambleton | Hambo Development

WE SPECIALISE IN WORKING WITH AGENCIES AND BUILDING LONG TERM DEVELOPMENT PARTNERSHIPS

Ryan Irelan

Posted: 25 November 2008 12:44 AM

[#1]

[ Rating: 0 ]

Everything is stored in the MAMP directory (not MAMP Pro directory) in your Applications directory. So, MAMP > db > mysql
will have the data for your databases. I would just back up the entire MAMP applications directory.
Signature
Joined: 2006-02-02
444 posts

Mijingo: ExpressionEngine Training Videos and Books

stinhambo

Posted: 25 November 2008 12:46 AM

[#2]

[ Rating: 0 ]

Excellent thanks! Why this isnt mentioned anywhere is a mystery to me.


Signature

Joined: 2007-01-05
1266 posts

Steven Hambleton | Hambo Development

WE SPECIALISE IN WORKING WITH AGENCIES AND BUILDING LONG TERM DEVELOPMENT PARTNERSHIPS

JT Thompson

Posted: 25 November 2008 09:39 AM

[#3]

[ Rating: 0 ]

you have to be very careful doing this. If ANY of the tables are open when you copy the db files youll corrupt the table. the
best way to do this would be to use the command line and export the databases that way.
My guess is its not mentioned anywhere because its a really bad way to backup databases
Joined: 2004-11-08
725 posts

You can use the following to dump all your databases and save all the hassle of using phpmyadmin. Also, using thelocktables option you wont corrupt them.
mysqldump [options]all-databases

You can also write a short script that will backup all your databases, then just cron it
#!/bin/sh
date=`date -I`
mysqldump --opt --all-databases | bzip2 -c > /path/to/yourbackup-$date.sql.bz2
Basic single db dump:
mysqluser=usernamepassword database < dumpfile.sql
Signature

Member: ExpressionEngine Pro Network: Mindzipper Development

Mindzipper Homepage

Mark Bowen

Posted: 25 November 2008 09:53 AM

[#4]

[ Rating: 0 ]

Or just use the PHPMyAdmin part of MAMP and then just back up your htdocs folder instead.
Best not to mess with all the files that MAMP creates unless you really know what you are doing. It can become very messy
very quickly. Trust me Ive been there!
Joined: 2006-04-15
12420 posts

Best wishes,
Mark

Signature
Shopping Cart Plugin | Full List Of Add-Ons | About Me

2.x Bug Tracker | Upgrade Errors

stinhambo

Posted: 25 November 2008 10:02 AM

[#5]

[ Rating: 0 ]

[#6]

[ Rating: 0 ]

JT Thompson - 25 November 2008 02:39 PM

You can also write a short script that will backup all your databases, then just cron it
Joined: 2007-01-05
1266 posts

#!/bin/sh
date=`date -I`
mysqldump --opt --all-databases | bzip2 -c > /path/to/yourbackup-$date.sql.bz2

This is excellent thank you


Now how do you write a cron and where do I write the above code?
Signature

Steven Hambleton | Hambo Development

WE SPECIALISE IN WORKING WITH AGENCIES AND BUILDING LONG TERM DEVELOPMENT PARTNERSHIPS

JT Thompson

Posted: 25 November 2008 10:17 AM

Unfortunately im not familiar with the environment youre referring to. I think someone that knows MAMP should answer
this. A cron is just a job that schedules running scripts or events and specific times. Since i dont know your environment I
cant really answer.
Joined: 2004-11-08
725 posts

As for the script itself, you can just paste that into a file on your server and set it to executable.
Signature

Member: ExpressionEngine Pro Network: Mindzipper Development

Mindzipper Homepage

Pascal Kriete

Posted: 25 November 2008 10:43 AM

[#7]

[ Rating: 0 ]

You can still use the regular crontab in leopard, but there are native alternatives as well. This is a pretty nice primer on how to
use those.
The script would then go into the directory you specified in the local_periodic setting, with executable permissions (sudo chmod
a+x filename).
Joined: 2008-01-07
2588 posts

One possible gotcha might be the socket. You may need to add that (/Applications/MAMP/tmp/mysql/mysql.sock) if it cant find
it by itself:

mysqldump -S /Applications/MAMP/tmp/mysql/mysql.sock --opt --all-databases | bzip2 -c > /path/to/yourbackup


Signature

Mark Bowen

Posted: 25 November 2008 10:48 AM

[#8]

[ Rating: 0 ]

Steven if you go to :
http://localhost:8888/MAMP and then click on PHPMyAdmin at the top of the screen and then on the page that comes up
click on Export on the right hand pane you will see the familiar database backup pane.
Joined: 2006-04-15
12420 posts

You can use this to backup all the databases at the same time if you wish. Personally myself I always back them up one at a
time as it is (in my mind) easier that way and also better if you need to then use the export on a site online.
Best wishes,
Mark
Signature
Shopping Cart Plugin | Full List Of Add-Ons | About Me

2.x Bug Tracker | Upgrade Errors

bmovie

Posted: 10 May 2010 08:07 PM

[#9]

[ Rating: 0 ]

I do the Mark method with phpmyadmin, always work BUT! I dont know which options check or not I always use (see the
screenshot attached) default options more Add Drop Table but I really dont know which check or not, anybody knows?
I see to this great app http://www.mysqldumper.net/ but I never use it so I dont know but looks great!
Joined: 2007-12-04
619 posts

they say:
What is MySQLDumper ?
MySQLDumper is a PHP and Perl based tool for backing up MySQL databases. You can easily dump your data into a backup
file and - if needed - restore it. It is especially suited for shared hosting webspaces, where you dont have shell access.
MySQLDumper is an open source project and released under the GNU-license.
The problem
A PHP script has a maximum execution time that is usually set to 30 seconds on most server installations. A script running
longer than this limit will simply stop working. This behavior makes backing up large databases impossible. Maybe you
already had this specific problem when using other tools.

Image Attachments

Click thumbnail to see full-size image

Mark Bowen

Posted: 15 May 2010 02:48 PM

[ # 10 ]

[ Rating: 0 ]

Try out Sypex Dumper for by far the fastest MySQL backup application Ive found so far.
A database that used to take around 40 minutes using any other backup method only takes around 14 seconds with this
backup programme!!
Joined: 2006-04-15
12420 posts

Best wishes,
Mark
Signature
Shopping Cart Plugin | Full List Of Add-Ons | About Me

2.x Bug Tracker | Upgrade Errors

bmovie

Posted: 15 May 2010 03:50 PM

[ # 11 ]

[ Rating: 0 ]

thanks mark I try it, by the way I import the database that I export with phpmyadmin with default settings and everything
works perfect, I dont have issues.

Joined: 2007-12-04
619 posts

20022016, EllisLab, Inc.


Privacy Policy, Terms of Service

built on ExpressionEngine
return to the top

PixelBuzz eNews

your e-mail

SIGN UP

S-ar putea să vă placă și