News:

Wondering if this will always be free?  See why free is better.

Main Menu

Java SMF automated database backup

Started by viulian, September 24, 2006, 05:00:55 PM

Previous topic - Next topic

viulian

If you use Internet Explorer, please go to the login prompt and select View menu, and from there the item "Source".
If you are using Mozilla Firefox, again, at the login page (on the ?action=admin URL I mean) press Ctrl-U.

Then, you should search the word "form".


The form tag, in HTML, should look something like
<form .... action="some_string_here" ....>

So please search for form and see, if between the '<' and '>' where the form stands if there an word named 'action'.

Thanks :)

philwojo

I use firefox and do see several instances of that and they all have this link:

<form action="http://www.aaaaaaaa.com/forum/index.php?action=login2 [nofollow]" method="post" accept-charset="ISO-8859-1" name="frmLogin" id="frmLogin" onsubmit="hashLoginPassword(this, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');">

Phil

viulian

Can you please PM me with an URL to your forum ?
I do not need any username / password - I just need to make sure that when you type in "http://www.aaaaaaaa.com/forum/index.php?action=login" you actually see an SMF login.

Maybe you have an additional password set in a .htaccess file which the browser lets you through as you already saved it, and only after that you are prompted with the forum login ?

I am sure that's something with a form that doesn't have an action :) but I can only prove it if I have a look..


Matthew Schenker

Hello,
I was using this tool when I was running Windows XP.  But I recently got rid of Windows and changed all my systems over to Linux (Kubuntu).

I would like to run the Java SMF Backup tool on Kubuntu, but I'm a little lost about how to do it.  Has anyone done this, and if so can you post tips or suggestions?

Thanks!

viulian

Sure!

For Ubuntu (I did not use Kubuntu but I assume it's almost the same) I did the following:

1. Install Sun Java SDK 1.5, Ant (for compilation)


apt-get install sun-java5-jdk
apt-get install ant


(and please accept the other dependencies / licenses).

2. Test the installation

You should issue java -version and see an output such as:

root@glimpses:~# java -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05)
Java HotSpot(TM) Client VM (build 1.5.0_13-b05, mixed mode, sharing)


3. Download Java SMF Backup zip (from the Downloads page) or from my page:

wget http://www.hex.ro/wb/tracker/EasyTracker.php?id=3

Unzip it then cd to the directory:

unzip JavaSMFBackup_v101.zip
cd JavaSMFBackup


4. Compile:

a) Edit file build.xml from the JavaSMFBackup directory and remove these three lines:

  <!-- launch4j task definition -->
  <taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask"
    classpath="${launch4j.dir}/launch4j.jar :${launch4j.dir}/lib/xstream.jar" />


b) Issue ant command

ant

You should see an output like this:

root@glimpses:~/JavaSMFBackup# ant
Buildfile: build.xml

init:
    [mkdir] Created dir: /root/JavaSMFBackup/bin
    [mkdir] Created dir: /root/JavaSMFBackup/dist
    [mkdir] Created dir: /root/JavaSMFBackup/installers

compile:
    [javac] Compiling 14 source files to /root/JavaSMFBackup/bin

dist:
    [mkdir] Created dir: /root/JavaSMFBackup/bin/img
     [copy] Copying 9 files to /root/JavaSMFBackup/bin/img
      [jar] Building jar: /root/JavaSMFBackup/dist/SMFBackup.jar
     [copy] Copying 1 file to /root/JavaSMFBackup

BUILD SUCCESSFUL
Total time: 4 seconds


c) From the same directory, issue

java -jar SMFBackup.jar

You should see the window and be able to use it as you did on Windows.
Maybe you should add a shortcut to your desktop (with running directory /root/JavaSMFBackup and command the java -jar from above.

Please let me know if it worked :)

Here's a proof (my setup is Ubuntu 6.06 with TightVNC as X window manager):




Matthew Schenker

viulian,
Thanks for the help on getting Java SMF Backup to run.

I'm still kind of new at using Linux, so all those steps get me a little anxious.  But I'll dive in later and give it a try, the report on how it works.

Thanks again,
Matthew

viulian

Matthew,

Did you get some time to set things up ? How did it went ?

Matthew Schenker

#48
Quote from: viulian on December 05, 2007, 05:21:21 AM&lt;br /&gt;Matthew, &lt;br /&gt;&lt;br /&gt;Did you get some time to set things up ? How did it went ?&lt;br /&gt;

Unfortunately, I can't seem to get it working.

For now, I'll just use the built-in backup system in SMF Admin > Forum Maintenance - Backup Database.

I'm still getting up to full speed on Linux, so it's probably something I'm doing wrong!

Matthew

viulian

Ok, I understand

I might help with your problem if you give me some error messages. But if you're ok with the standard backup, no rush :)


AlphaHot1

Thanks for the great program. Any chance that we'll have a command line only version?

It just needs to run the backup, everything else it's fine from the gui.

Something like:

SMFBackup -doBackup

This way I can use it with wget and do fully automated backup, it wold be wonderful, thanks ;)

viulian

Never thought of it :) and thank you for the kind words.
I liked more the ideea of seeing the log, the download speed, so I did not do a command line version.

Anyway, I would like to work on a different approach on the next version I work on. The trouble with the forum is that if the database reaches sizes of 150Mb or so, forum's built in backup doesn't work anymore as php process doing the backup will die with an 'Out of memory' error.

But I'll try and add - if you have any ideeas, please let me know :)

AlphaHot1

Thanks for the quick response, however I've found an opern source php script phpMyBackuPro which can do a scheduled dump of the db on the server, so if it works I have just to download everything with wget ;)

viulian

Yeah, that's another good ideea - given that you have access to a shell / crontab editor. I too do backups that way (but created my own cronjob as it was less hassle - using mysqldump instead of php).

AlphaHot1

I agree: my idea is to use crontab on my local machine beacause I don't have any shell account on the server neither I can use mysqldump (the db on my host accepts connection from localhost only).
That php script can do a scheduled backup in a clever manner: it loads the script everytime the main forum index is loaded (with a transparent gif ora an invisible frame), and if enough time has passed since the previus backup, it runs the backup.

This way I can do everythong from my local machine with wget and cron. The other solution would be to use your app via command line, but if I can I'll save you the hassle ;)

Thanks!

Oscar

Thank you for the program. I like the simple interface and easy to use schedule options. (I do not always remember to make back-ups of the database.)

Two questions:

+ Doe this application make a complete backup of the database? (As in could I use its file for a full restoration of everything in the sql database?)

+ Does anyone have tool that will restore a large database? Could that be built into this application? (My sql.gz files are too large to upload via phpadmin and I do not have shell access.)

Thanks,
Oscar

viulian

Hi Oscar!

Thank you for using my software!

1) the application makes a complete backup, yes. It is actually a 'browser' which does the clicks for you and downloads the database that in fact the forum admin page creates. And that's complete (in fact I use these databases to setup my local environment and it works).

2) Application doesn't have support for restore. It tries to do what's 'painful' to do [having regular backups] however a restore is very rarely needed. And if it happens, you should just upload the latest .sql via FTP along with, for example, the script from here: http://www.ozerov.de/bigdump.php; you execute script and it should do the import for itself then).

But yes, it can be built in the application - however - only few people have requested it so I didn't thought of it as a priority..

I'll think about it :)


kizer

Awesome app. I use it every day. I let my PC at home idle and it backsup. At first I didn't trust it so I backed up and opened up the files and looked for that last post and sure enough it was there.

Restore feature would be cool like requested an or a command line for us command line junkies. I run BSD at home so it would be great to let it do its thing several times a day so I dont have to worry about it.

Anyways thanks for the app.
Own a Jeep? Links4Jeeps.com

mitch2k

Hey! The backup tool looks great. But I keen getting this error:

09:55:53] Method failed (downloadAction): HTTP/1.1 500 Internal Server Error

Any idea?

viulian

Can you do backups using SMF admin web interface ?
Please try it, I think you are getting the internal server error too there (probably some redirects or some additional security added in .htaccess file - assuming that you are using Apache).

Please check and let me know.

Advertisement: