1

Topic: Backup database?

Ok, i need to move punbb and my site from the current host to my own server. I need a "backup" feature... And move the backup to my server and get it installd there.
It would be nice if there where some type of backupsystem, and restore system.

*happy codeing*

Re: Backup database?

Well, I don't think I've ever seen a host that doesn't provide some sort of administration interface for the databases it offers. phpMyAdmin i.e. has an export function.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3

Re: Backup database?

that would be a good feature, for those who do not have access.

Re: Backup database?

It would be a nice feature, but there are other features I think have much higher priority.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Backup database?

http://www.phpmyadmin.net/

I'm not sure, but cannot you install this on your page, and use it from that.

Re: Backup database?

One advantage of an "in-board" backup of only the data (topics, posts, users, settings etc) and not the table-structure itself, is that you can dump the forum, from say a mysql db, and import in into a pgsql-installation from within theadmin-interface of the board.

Just a thought tho.

7

Re: Backup database?

uhm, downloading and installing PHPMYAdmin is a HUGE security risk, that is all i have to say on that one. if the person installing it made
ONE mistake in pretecting the directory (trust me its easy to get in a password protected directory thats done with .htaccess files) has just made the server vulerable to things that can pretty much kill the whole thing.

Re: Backup database?

I'm not following you here. Why fiddle with .htaccess? Just set auth_type to http in config.inc.php and you're all set to go.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

9 (edited by ps21 2003-09-07 02:01)

Re: Backup database?

Personally I would just go and get the 30 day free trial of Sqlyog. That will backup databases, create backup scripts, copy databases from one server to another or synchronise two servers. I am of course assuming you have access to a windows machine to install the app on.

10 (edited by RNilsson 2003-09-07 02:41)

Re: Backup database?

It's really not a big bother to me if it's included or not as i run both phpmyadmin and phppgadmin on a protected subdomain on my local server (i use this as basepoint for all db-admin) but it would be nice to have the db-data-dump included.

Not all have the skills or ability to use a admin-tool as it's generally requires a little "hands-on" with installing such scripts.

ps21; If the db-server only allow 'localhost' access, you have to make backups/restore etc from the webserver(script) or via ssh/similar. Just as a note.

Mod anyone? smile

11

Re: Backup database?

There are some scripts out there that you could use to backup a MySQL database.

http://www.absoft-my.com/pondok/backup.php?direct=1

If you'd like, I can try to integrate this script (or another) into PunBB and offer it as a mod.

"You start coding. I'll go find out what they want." - Computer Analyst to Programmer

12

Re: Backup database?

thats a nice little script big_smile

13

Re: Backup database?

RNilsson wrote:

ps21; If the db-server only allow 'localhost' access, you have to make backups/restore etc from the webserver(script) or via ssh/similar. Just as a note.

I try to learn one new thing everyday. Thank you for taking care of Sunday smile

Re: Backup database?

ps21 wrote:
I try to learn one new thing everyday. Thank you for taking care of Sunday smile

You're very welcome smile

Re: Backup database?

For a big forum (big datafile), be aware of scripttimeout, max upload file size etc as well when/if implementing backup/restore-routines.

I've got an old phpbb1.4 board that is 10mb, another phpbb2 forum in the 30mb-size, and this is a pain to handle i tell you... =/

Anyways, i don't think the search-idx tables would need to be backed up as a new serchindex should be built after a restore, if your changing db-type atleast.

16

Re: Backup database?

Alright.

Question, how do you get around script timeout. I have never learned that because I never needed to know.

"You start coding. I'll go find out what they want." - Computer Analyst to Programmer

Re: Backup database?

set_time_limit(0)

It doesn't work on all servers though. I think you can configure whether PHP (php.ini) allows changing the time limit in runtime or not.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

18

Re: Backup database?

another way is to contact your host, i dont have problems with timeout, i have uploaded a 200mb backup file onto my website before.

19 (edited by RNilsson 2003-09-07 21:42)

Re: Backup database?

That would not work on hosts similar to webhotels where you don't have your own server/config-persmissions.

One possibility when dumping would be to do backup in 2000 bit chunks with automatic naming like: backup_0-2000.sql, backup 2001-4000.sql or with a userdefined value if the host can take a higer value (the user could experiment on this)

An alternate would be to make the script dump the to a local dir within the admin-dir via the fputs (?) and just append to the file in 4k chunks.
Same with restore, to have an option to read a file in a local file-path with fopen and let it read in 4K chunks.

This way the sql-file can be accessed via ftp.