Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » My updates in backup routine
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
My updates in backup routine [message #186635] Mon, 13 October 2014 21:47 Go to next message
Atomicrun is currently offline  Atomicrun   Sweden
Messages: 54
Registered: November 2010
Location: Lund
Karma: 0
add to buddy list
ignore all messages by this user
I use the FUD-forum in three different applications. One of the applications use the forum as a data file repository, with many very large attachments. I have also used a slow computer as the server; in fact, the server computer did not have any CPU-fan.

My first update is to list every file saved in the backup on screen. The issue was that the browser disconnected from the server during backup, after waiting several and many minutes for the "data" backup. The browser need the server to regularly print a char to show that it is still operating, and my solution was to modify "adm/admdump.php" to print each file name. The largest single attachment is not large enough to stall the backup until time-out.

Backup and restore is often associated with various crashes, and a detailed printing of included files is helpful.

Next issue is that the standard script don't backup all things. If you made any modification, or added files and directories, this is not included in the backup. It is very easy, however, to include these extra directories.

The backup install script rebuild the site using the Themes. Unfortunately one of my applications use the main page to display a status page from an external software/hardware. My solution is to include the WEBB/theme directory in the backup, and remove the rebuild of the Themes, that erase the modification. It would be nice if I could include the modification before the Themes is built, but I have not been able to find the correct file/spot, as it should glue itself in between parts in the end of the page.

The install-backup script "adm/admimport.php" is not very forgiving, and will typically abort completely on any error. This will leave your site without files and without a database. My guess is that you administrator account will be missing too. Unfortunately some of us may have limited access to the Server, and you will need a forum-files backup and a database backup to restore a working version of the forum. A backup routine is a boring thing until you need one. It would be moderately difficult to temporarily include an extra log-in, that is in a php file and do not use the database, to allow a restart of the backup-restore-script admimport.php

My exact problem was in the "fud30_calendar". Some completely unknown holidays "Cinco de Mayo", "Veterans Day", "Second day of the month, do your time sheets." is registered as NULL, NULL, NULL; and the import value-check of the database don't like this on import. So it bug out with an error!
I don't use the calendar, and deleting these lines from the database using phpMyAdmin, and rerun the backup script on the undamaged forum solves the problem. And if you don't have an undamaged forum to run a new backup on, but really have a problem, then you need to edit inside the backup file.
A better solution would be to have the backup-restore script to skip over small errors, but this could also fail in case the error is not small, it could be the admin account that don't install in the database.

The "adm/admimport.php" also include a little line
if ($path == 'WWW_ROOT_DISK/adm/admimport.php' ) 
   // Skip admimport.php, don't overwrite the running script.

and this little exact-match have to be written
if ($path == 'WWW_ROOT_DISKadm/admimport.php' ) 

if it shall catch the import script, and not overwrite itself during backup-reload, which can be dangerous. My solution is to use
if ( substr_count( $path, 'admimport.php') > 0 ) 
   $path = $path . '.orig';
pf('Restore File '. $path );

which print the import file using a safe name admimport.php.orig and also, on the bottom line, print a list of all unpacked file names, so you can check there are all there. Manually.

So, I now run an a new server, that has these DDR2-RAM and also a fan ontop the CPU. I am not surprised of the backup-and-restore problems I found, but some small changes could save hours in case there is a small glitch.

You shall also note that I run 3.0.3 version of the forum.

A "recover.php" that check for secret code and enable a restart of the backup-restore-process.

Backup all the files. Backup from the roots, and all subdirectories. Do not mess with a backup of only "necessary" files.

Restore the database one table at a time. If there is an error, print the backup to a text file, and skip to the next table. Possibly can the error be corrected in the database or in the text file, then you can install the table using a little cut-and paste in phpMyAdmin.

Remove the automatic "rebuild themes" in admimport.php

Check that the php script is allowed to write the files before it runs, check with one file in the DATA directory, one file in the WEBB directory, and create a temp table in the database.

I will, in future, keep also an ordinary files backup of my server, as a complement to the FUD-forum backup (modified).
Re: My updates in backup routine [message #186637 is a reply to message #186635] Tue, 14 October 2014 10:32 Go to previous message
naudefj is currently offline  naudefj   
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Core Developer
remove from buddy list
ignore all messages by this user
Great post! I don't have much time right now, but will defiantly test / implement your changes later.

Best regards.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Including a default robots.txt file
Next Topic: Selected PDF
Goto Forum:

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Oct 21 13:46:55 EDT 2017

Total time taken to generate the page: 0.00650 seconds