• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Addon for database backup

borbole

Well-known member
#5
It's not a XF mod, but my host pointed me at mySQL Dumper the other day.
It is a great tool. I use it quite a lot and I have never had problems with it.

No addon? The addon with Vb is so nice and easy, wish there was one similar to the one done by Paul M. :(
If your db is small then it can be done that way, but when it grows then it would much better to do the backups through other means, like the mysqldumper mentioned above or through SSH or Telnet, providing your host allows such connection.
 

xfrocks

Well-known member
#6
For any MySQL backup, restore work, I prefer doing this in console/ssh:

Backup
Code:
mysqldump -u <username> -p <database-name> > backup.sql
(you will be asked for password, input then press enter then wait)

Restore
Code:
mysql -u <username> -p <database-name> < backup.sql
(you will be asked for password too)

Works well with gigabytes backup (raw .sql). You can gzip the .sql file later to download etc.
 

Andy.N

Well-known member
#7
Restore
Code:
mysql -u <username> -p <database-name> < backup.sql
(you will be asked for password too)

Works well with gigabytes backup (raw .sql). You can gzip the .sql file later to download etc.
Would restore step drop all the tables in the database-name before uploading it? Or it will just overwrite/update?
 

SchmitzIT

Well-known member
#10
Nope. But you can do that this way

Code:
mysqldump --add-drop-database -u <username> -p <database-name> > backup.sql
More info: http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
I used to use this approach as well. However, this does require access to the account running the mySQL process. On our new VPS I did not have this, and the mySQLDumper script forms a (for me) perfect alternative for it, without requiring me to shell into the box.
 

onthefly

Active member
#11
Why do I get this error when trying to do a backup in ssh?

mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
 

Dodgeboard

Well-known member
#14
The cool thing is, it does not require extra authentication. Plus, it's FASSSSTTTTT! Takes me about 1 minute to backup my 300mb database. Then you can even choose to download it. It's probably my most used, and most beneficial add-on for XF.

I even use it to sync databases between my live board and my dev board. I can't say enough about it....and it's FREE! :D
 

Andy.N

Well-known member
#15
Sounds like it will be on my to-install list.
Can't you just schedule it to email/download/FTP somewhere instead of manually doing it.
 

Dodgeboard

Well-known member
#16
I don't know about the scheduling. I don't think so. It doesn't use a cron. But it only takes one click <execute>. There are some advanced settings in the ses.php and cfg.php files, but I've not really played with them much.

I like the manual part about it - that way, when I make a change or get ready to apply an upgrade, I can make a quick backup in seconds right from the admincp and right before making the plunge.
 

SchmitzIT

Well-known member
#17
I just played with mySQLDumper this morning, and discovered it also supports multiple databases. On our main site, we have a database for the forums, and one for the wiki, and thus the Sypex might not be ideal for us for that purpose.And from what I saw, scheduling is possible using mySQLDumper by means of cron jobs, which would also be somewhat essential for my needs.

But yes, I will probably be using Sypex on some of my sites anyway. It looks too cool not to :)