Make forum datadump - fudforum/FUDforum GitHub Wiki
The Forum Backup admin control panel allows the administrator to generate a backup of all the forum data that is stored on disk and in the database. If PHP's gzip module is available the administrator may choose to compress the backed up data, to save drive space. This backup can later be restored to a forum running the same version of the forum.
Note: Responsible forum administrators will not only backup their forums regularly, but also perform test restores after making changes or upgrading to newer versions of the forum.
IMPORTANT: You cannot restore to a different version of the forum. You may want to save a copy of the install script with your backup files.
Enter the full path on disk where you wish to save the forum data dump or accept the default (forum's tmp directory).
Compress the backup file using Gzip compression. This will make the backup process a little slower, but will save a lot of harddrive space. The default is Yes.
Do not backup search related database tables. If you select this option you will have to rebuild your search index after importing the dump. This will make the backup much smaller and quicker, especially on large forums.
Besides using the provided Admin Control Panel, users may also need to run backups from command line and schedule them via cron or other system schedulers.
To run a command like backup, you need to be in the forum's adm directory:
cd .../forum/adm
Run admdump.php with PHP's command line interpreter to see usage info:
/usr/bin/php ./admdump.php Usage: php admdump.php /path/to/dump_file [compress] - 'compress' is optional; specify only if you want to compress the dump_file.
OK, let's run it by specifying the dump_file as the first argument:
/usr/bin/php ./admdump.php /tmp/forum.fud
Here is a crontab like that can be used for automated forum backups:
# Weekly forum backups 0 1 * * 6 (cd /var/www/adm/; /usr/bin/php ./admdump.php /tmp/backup.fud compress) >/tmp/backup.log 2>&1
The backup script supports authentication via HTTP. The example below demonstrates how to take scheduled forum backups using this technique:
Example of an automated Forum Backup Script:
echo -e 'submitted=1\n&compress=1\n&path=/home/user/forum/backup/FUDforum_'`date +%Y%m%d`'.gz' | lynx http://YOUR_FORUM_URL/adm/admdump.php?do_http_auth=1 -auth=ADMIN_LOGIN:ADMIN_PASS -post_data
The parameters that are piped to the lynx utility represent the POST data. There are 2 arguments that you can change.
- path This represents the full path on your hard-drive where the backup file will be written to.
- It is imperative that the user and/or group web-server runs as, has write access to that directory.
- compress whether or not to compress the backup.
- By default this option is set to 1, meaning that the archive will be compressed using zlib. If you wish to disable compression, change the value of this option to 0.
Needless to say, the YOUR_FORUM_URL should be replaced with your forum's URL.
- Import forum data, admin control panel for restoring a forum from a backup.
- Dropbox.plugin, store dump files off-site.
- Ftp_backup.plugin, use FTP to copy dump files off-site.