PDA

View Full Version : Main Control Panel: Including SSH Backup & Restore Through Your AdminCP!


N9ne
03-14-2003, 10:00 PM
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Main Control Panel Hack, by N9ne \\ Created on March 15th 2003. \\ Copyright N9ne, 2003+.
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Description: This hack will add a page to the adminCP. On this page, there are many settings.
You can set which userids can access this page and its options in config.php
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Options available on page:
- Overwrite database with a backup
- Create backup
- Reset post counts
- Include Administrators?
- Delete 0 posters
- Prune all threads and posts
- Prune all PMs
- Delete all smilies
- Delete all icons
- Delete all custom avatars
- Delete all avatars
- Delete all attachments
- Delete all announcements
- Delete all forums
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
You require SSH or telnet access on your server in order to run this hack. It will be running
mysql < and mysqldump > commands, so they must be installed. This may not work on all
windows systems. If you want to run this on localhost with a windows OS, you will need to add
chdir commands before mysql and mysqldump executions.
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Level of hacking: Easy
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Time Taken: 1 minute.
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Files to modify:
admin/index.php
admin/adminfunctions.php
admin/config.php
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Files to upload:
admin/maincontrol.php
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
In the attached .zip file you can find: A screenshot of some of the options \\ Instructions for installation \\ maincontrol.php

assassingod
03-15-2003, 01:10 AM
Exellent! Just what I needed! Brilliant work!

Thanks N9ne:)

Merjawy
03-15-2003, 01:22 AM
very nice indeed.. I will install tonight

thnx

DrkFusion
03-15-2003, 01:28 AM
You have released a total package, I will be suprised if this hack doesn't get a million installs :p

Talisman
03-15-2003, 01:54 AM
Count me in. Thanks N9ne.

Velocd
03-15-2003, 02:18 AM
Nice stuff, I will have to look into this hack. ;)

* Velocd clicks install

refertech
03-15-2003, 02:24 AM
Very elite hack. :)

Thanks,

Mark

joeboo
03-15-2003, 03:42 AM
Grr.. this hack comes out right after my database crashed. My backup was only half completed (timed out) XD Very nice though.

LangTuDaTinh
03-15-2003, 04:08 AM
Create backup is good but other features.....hehee it's best to do it via phpmyadmin. one wrong mouse click can erase all.

Chris M
03-15-2003, 06:45 AM
True;)

Nice hack N9ne...Shame I won't be able to test it out:(

Satan

partang2
03-15-2003, 07:21 AM
Will this work with 2.2.9?

assassingod
03-15-2003, 07:49 AM
Today at 09:21 AM partang2 said this in Post #11 (https://vborg.vbsupport.ru/showthread.php?postid=366555#post366555)
Will this work with 2.2.9?

I shouldn't see why not.

Intex
03-15-2003, 09:04 AM
Nice work N9ne. I'll install this soon :cool:.

Sliderx
03-15-2003, 09:09 AM
nice hack

Dean C
03-15-2003, 09:27 AM
Very nice idea. This is a very touchy hack so it will be interesting to see the bugs flood in ;)

- miSt

AllMadden.net
03-15-2003, 12:57 PM
After doing the install I am getting this error when trying to log into my vB admin:

Parse error: parse error, unexpected $ in /home/virtual/site4/fst/var/www/html/madden/forums/admin/index.php on line 346

Not sure what it causing it...I didn't edit anything but what the file said...

Schorsch
03-15-2003, 01:09 PM
hmm I can't create a backup with your hack.

I get the message "Backup complete.", but nothing is in the folder.

I have full SSH access and can manually create a dump via mysqldump.

what could be wrong ?

regards,
Schorsch

assassingod
03-15-2003, 01:59 PM
Today at 02:57 PM AllMadden.net said this in Post #16 (https://vborg.vbsupport.ru/showthread.php?postid=366695#post366695)
After doing the install I am getting this error when trying to log into my vB admin:

Parse error: parse error, unexpected $ in /home/virtual/site4/fst/var/www/html/madden/forums/admin/index.php on line 346

Not sure what it causing it...I didn't edit anything but what the file said...

Could you post line 346 for us? I am guessing you have an extra $ in that line of code

Link14716
03-15-2003, 02:35 PM
* Link14716 installs. :)

Good job N9ne.

ZiRu$
03-15-2003, 04:38 PM
You mentioned a WINDOWS host.....will this work on a host that is powered by UNIX?

N9ne
03-15-2003, 05:15 PM
I mentioned that it might not work on a windows server. It should work on unix systems though.

AllMadden: Please post the code on and around that line.

Schorsch: What are the details of your server? What is the OS being used? Try executing this command from an SSH window on your server:

mysqldump --opt -uDBUSERNAME -pDBPASSWORD DBNAME > /path/to/backup/file.sql

Tell me if that works.

Derek
03-15-2003, 05:22 PM
How can I make it so that I automatically have the folder I want my backups to go in remembered? I tried placing it in the code, but it didn't work... ideas?

N9ne
03-15-2003, 05:38 PM
Today at 07:22 PM Derek said this in Post #22 (https://vborg.vbsupport.ru/showthread.php?postid=366830#post366830)
How can I make it so that I automatically have the folder I want my backups to go in remembered? I tried placing it in the code, but it didn't work... ideas?


Open maincontrol.php

Find:

makeinputcode("Full path to folder where you want to create the backup file (<b>With</b> trailing slash)","dumpfilepath","");


Replace with:

makeinputcode("Full path to folder where you want to create the backup file (<b>With</b> trailing slash)","dumpfilepath","/path/to/backup/folder/");


Change the path, and it should work.

Schorsch
03-15-2003, 10:48 PM
Yesterday at 08:15 PM N9ne said this in Post #21 (https://vborg.vbsupport.ru/showthread.php?postid=366826#post366826)
Schorsch: What are the details of your server? What is the OS being used? Try executing this command from an SSH window on your server:

mysqldump --opt -uDBUSERNAME -pDBPASSWORD DBNAME > /path/to/backup/file.sql

Tell me if that works.

I use SuSE Linux 8.1

the mysqldump command works without problems (used this many times before).

N9ne
03-15-2003, 10:51 PM
Well I'm really no expert on SSH/telnet or servers...so I guess the problem is out of my hands, and I suppose that's a feature you won't be able to use, until I somehow figure out a way to make it work. Sorry :(.

alkatraz
03-18-2003, 07:06 AM
awesome!!!!!!!!!!! I've been waiting for something like this for a long time
thx!

Areku
03-18-2003, 10:21 AM
Any screenie? ;)

Schorsch
03-18-2003, 10:24 AM
Today at 01:21 PM Areku said this in Post #27 (https://vborg.vbsupport.ru/showthread.php?postid=368544#post368544)
Any screenie? ;)

look in the zip file

N9ne
03-18-2003, 02:32 PM
Today at 09:06 AM alkatraz said this in Post #26 (https://vborg.vbsupport.ru/showthread.php?postid=368485#post368485)
awesome!!!!!!!!!!! I've been waiting for something like this for a long time
thx!


hehe no problem :). I'm glad there's quite a bit of enthusiasm for this hack, version 1.1 may be on its way soon though, with some fixes.

romanticyao
03-19-2003, 11:11 AM
great! many thanx!

AllMadden.net
03-29-2003, 03:47 PM
Sorry I didn't post the line of code...I fixed that.

But I do have another question. Where does the maincontrol.php go? forums/admin/ ?

I put it there and the options didn't show up in the admin cp (unless I am just blind and don't see them.

N9ne
03-29-2003, 03:53 PM
Upload maincontrol.php to your admin directory. Make sure you've made the modifications to admin/index.php to make it show in the navigation.

Entourage
04-10-2003, 09:01 AM
nice hack! Works lovely. Tnx

tkeil69575
04-25-2003, 04:07 PM
great hack - absolutely perfect. thanks n9ne

tina

N9ne
04-25-2003, 07:16 PM
Please click install Tina :)

brianoneill
04-26-2003, 05:34 PM
I Have it installed ok, but having problems doing a backup.

Is it the case that it will only backup to a location on the same server? Or will it backup to your local machine?

If it will only do it to the server would someone mind posting an example of a path so I know what to try.

I ain't to hot on linux :ermm:

Thanks in advance.

Brian

N9ne
04-26-2003, 07:11 PM
If you have cPanel, most likely the path will be something like:

/home/YOURACCTUSERNAME/public_html/these_are_folders_viewable_by_the_world

And you are correct in saying that they will only backup to the server. It will create a file on your server which you can then download to your local machine.

subu1
04-26-2003, 07:32 PM
for which I should delete the Threads and Postings I don't understand

regards,
greetz subu1

rake
04-27-2003, 07:07 AM
Very nice hack indeed. I'm not going to use it since i like doing everything myself, but i suggest adding an option to replace

mysqldump --opt
with
mysqldump --add-drop-table --all

since some servers might have restrictions on locking tables.
EDIT: By the way, it is guaranteed not going to work on a windows server, since the sytaxes for mysqldump and mysql are different.

brianoneill
04-27-2003, 09:48 PM
Yesterday at 09:11 PM N9ne said this in Post #37 (https://vborg.vbsupport.ru/showthread.php?postid=387576#post387576)
If you have cPanel, most likely the path will be something like:

/home/YOURACCTUSERNAME/public_html/these_are_folders_viewable_by_the_world

And you are correct in saying that they will only backup to the server. It will create a file on your server which you can then download to your local machine.

Any idea what the path would be for a plesk server?

Thanks

Brian

Pollo
04-28-2003, 12:40 AM
On a Plesk server, your path to your viewable HTML docs should be:
/home/httpd/vhosts/yourdomain.com/httpdocs

You might want to create a folder below this for backup purposes, such as:
/home/httpd/vhosts/yourdomain.com/forumbackup
-and FTP in to download it to your local machine.

SemperFidelis
05-28-2003, 02:02 PM
First up, great hack and thanks for all your efforts in coding it.
Its functions have worked flawlessly.


However, I posted 2 support threads :
https://vborg.vbsupport.ru/showthread.php?s=&threadid=52636
and
http://www.vbulletin.com/forum/showthread.php?threadid=72261

And finally, I tracked the issue caused down to this hack and its changes to adminfunctions.php

Replacing this:

// ###################### Start makeinputcode #######################
function makeinputcode ($title,$name,$value="",$htmlise=1,$size=35) {
// makes code for an imput box: first column contains $title
// second column contains an input box of name, $name and value, $value. $value is "HTMLised"

if ($htmlise) {
$value=htmlspecialchars($value);
}

echo "<tr class='".getrowbg()."' valign='top'>\n<td><p>$title</p></td>\n<td><p><input type=\"text\" size=\"$size\" name=\"$name\" value=\"$value\"></p></td>\n</tr>\n";
}


With :

###################### Start makeinputcode #######################
function makeinputcode ($title,$name,$value="",$htmlise=1,$size=35) {
// makes code for an imput box: first column contains $title
// second column contains an input box of name, $name and value, $value. $value is "HTMLised"
if ($htmlise) {
$value=htmlspecialchars($value);
}
echo "<tr class='".getrowbg()."' valign='top'>\n<td align='left' valign='middle' width='65%'><p>$title</p></td>\n<td align='right' valign='middle' width='35%'><p><input type=\"text\" size=\"$size\" name=\"$name\" value=\"$value\"></p></td>\n</tr>\n";
}



Is anyone else experiencing this issue ?
And if so do they have a fix for it ?

ajk
11-18-2003, 07:22 PM
This is very nice!

I tried the MySQL backup to reinstall.
This is the path I used:
./admin/backup/vbulletin.11.15.sql

I got a "please check maincontrol path"

Can anybody help out?

I also tried it with the full path: public_html/forums/admin/backup/vbulletin.11.15.sql
That syntax just caused a blank screen in the maincontrol.php window.

My host doesn't let me use /public_html/blah...
BTW, the file I am importing is 147MB.

Thank you!

Red Blaze
02-12-2004, 02:50 PM
I guess I get the same thing as ajk.
I have a back up and I want to overwrite the current database.
I give it the fullpath to the .sql file and also gives me what ajk got. I do have the SSH active, so what else is missing?

gmarik
02-16-2004, 03:14 PM
Man, if this would be on vB3 ... wow

o0stephane0o
10-30-2004, 08:01 AM
CanĀ“t you port it to vb3?

o0stephane0o
12-01-2004, 03:55 PM
I guess you can?t :(