Problem restore xamp

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Problem restore xamp

Postby amateolo » 23. October 2011 15:00

Good morning,

I have a problem is this, when attempting to restore a backup I get the following error:

root @ mantis: / opt / lampp / backup # sh xampp-backup-21-10-11.sh
xampp-backup-21-10-11.sh: 7: function: not found
egrep: md5sums: No such file or directory


The operating system version is Ubuntu server x86 11.04

Can you help me? It is very urgent.

Thanks!
amateolo
 
Posts: 1
Joined: 22. October 2011 18:39
Operating System: Ubuntu Server 10 lts

Re: Problem restore xamp

Postby JonB » 24. October 2011 02:09

is this your exact syntax, or has that been edited>

root @ mantis: / opt / lampp / backup # sh xampp-backup-21-10-11.sh

Thanks
8)
(I am not at work so I don't have access to my XAMPP linux box right now)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Problem restore xamp

Postby gakon77 » 04. November 2011 08:34

Hello there.

I have the very same problem in Debian 6.0
The backup command works fine but when I try sh to restore the resulting file I find this:

root@enrique:/opt/lampp# sh xampp-backup-03-11-11.sh
xampp-backup-03-11-11.sh: 7: function: not found
egrep: md5sums: No such file or directory

It doesn't matter if I do sh in /opt/lampp as in the example or in /opt/lampp/backup always get the same output..

Thanks.
gakon77
 
Posts: 5
Joined: 04. November 2011 08:25
Operating System: Debian 6.0 Squeeze

Re: Problem restore xamp

Postby JonB » 04. November 2011 12:09

Code: Select all
root@enrique:/opt/lampp# sh xampp-backup-03-11-11.sh


try this:

Code: Select all
root@enrique:/opt/lampp/backup# sh ./xampp-backup-03-11-11.sh


Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Problem restore xamp

Postby gakon77 » 04. November 2011 17:38

Hi JonB, thanks for your quick reply!

It's still not working :(

Code: Select all
root@enrique:/opt/lampp/backup# sh ./xampp-backup-03-11-11.sh
./xampp-backup-03-11-11.sh: 7: function: not found
egrep: md5sums: No such file or directory


Is it possible that it has something to do with the security settings? I haven't run the security script.

Thanks again!
gakon77
 
Posts: 5
Joined: 04. November 2011 08:25
Operating System: Debian 6.0 Squeeze

Re: Problem restore xamp

Postby JonB » 04. November 2011 21:14

Well, I just tested - LAMPP backup worked correctly out of the box for me. I had backed up with LMAPP before, but not restored. I use an rsync account and webmin to backup to rsync.net normally.

Code: Select all
[jonb@localhost ~]$ su
Password:
[root@localhost jonb]# /opt/lampp/lampp backup
Can't access database. Is MySQL running? Added the MySQL root password to end of command line?
[root@localhost jonb]# /opt/lampp/lampp backup aaabbbccc
Backing up databases...
Backing up configuration, log and htdocs files...
Calculating checksums...
Building final backup file...
Backup finished.
Take care of /opt/lampp/backup/xampp-backup-04-11-11.sh
[root@localhost jonb]# cd /opt/lampp/backup
[root@localhost backup]# ls -l
total 30012
-rw-r--r--. 1 root root 10587353 Nov  4 15:38 xampp-backup-04-11-11.sh
-rw-r--r--. 1 root root  9212172 Aug  8 13:38 xampp-backup-08-08-11.sh
-rw-r--r--. 1 root root 10925790 Sep 30 04:27 xampp-backup-30-09-11.sh
[root@localhost backup]# sh xampp-backup-04-11-11.sh
Can't access your MySQL database.
a) Did you start it?
b) Add the MySQL root password to end of command line
[root@localhost backup]# sh xampp-backup-04-11-11.sh aaabbbccc
Checking integrity of files...
Restoring configuration, log and htdocs files...
Checking versions...
Installed:   XAMPP 1.7.4
Backup from: XAMPP 1.7.4
Restoring MySQL databases...
Restoring MySQL user databases...
Backup complete. Have fun!
You may need to restart XAMPP to complete the restore.
[root@localhost backup]#



OK, and now I am very relieved - as I didn't "smash my nice Linux/LAMPP box to smithereens". Its working fine after I restarted XAMPP/LAMPP.

I tried 3 or 4 of my applications, and phpMyAdmin - all work just fine.

So I can't replicate your problem, just be sure to include the PW for 'root' in MySQL at the end of the line.

I'll 'ask the guru'
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Problem restore xamp

Postby gakon77 » 05. November 2011 13:48

Hi,

I haven't mention that I'm running the 1.7.7 version.

Anyway, after you post the last reply I set passwords for XAMPP, MYSQL/phpmyadmin, etc... because I didn't do it before and thought that it may be the problem. :?

Then I did run the sh script but with the passw at the end. Unfortunately the result is exactly the same . :(

Hope the guru can shed some light over my restoration problem.

Thanks.
gakon77
 
Posts: 5
Joined: 04. November 2011 08:25
Operating System: Debian 6.0 Squeeze

Re: Problem restore xamp

Postby JonB » 07. November 2011 18:11

OK, here is the report from the 'guru' (apparently, that would now be me) -

A. - The problem is most likely that your backups are corrupt. LAMPP Backups ONLY work when you are logged in as root. Note the errors you got - they were generated by the next to last step here - the script '/opt/lampp/share/lampp/backup.head' which is tacked on (catted) to the backup archive in the next to last step (before the temporary files are deleted) Read through this next part, and you will be ready to debug:

B. - Here's how to debug your problem. You will need to run some commands from term/CLI. You will also need to understand (to some extent) the bash script(s) that are being run, the 'root/start' script would be /opt/lampp/lampp. Use an editor to peer into the script files mentioned.

/opt/lampp/lampp

Right around line 493, if the case is the parameter is 'backup', another script is called: /opt/lampp/share/lampp/backup. This is the workhorse, and location of whatever did not work during the backup, failed.

/opt/lampp/share/lampp/backup

The first part sets up the work and does a MySQL validation -

Lines 35-51 iterate the databases found, and writes each database out to a .sql text file.

Line 53 gets the current XAMPP version information

Line 55 stuffs these files and folders (/opt/lampp/etc /opt/lampp/htdocs /opt/lampp/logs /opt/lampp/phpmyadmin/config.inc.php) into data.tar.gz

Line 58 gets the checksum of (data.tar.gz VERSION *.sql) Static files + version-info + all the .sql files)

Line 61 stuffs the prior outputs into a new 'master' backup 'backup.tar.gz'

Line 62 concatenates/joins (cat) a bash header (/opt/lampp/share/lampp/backup.head)onto the 'master' backup file just created, so it can be run as a script later. All of that (the output of cat) is stuffed into your dated backup file.

Line 63 erases all the temporary files -- for debugging I would comment it out, and examine then the archive outputs to see if they are valid archives, and check the MD5 Checksum.

You should read through these files to look for your problems. try running the commands line by line and see where they error out.

OK, you have the roadmap now. :shock:

Since this worked perfectly on my my machine, that indicates you probably had problems with ownership, permissions, or user access (who you were logged in as taking the backups)

You all owe me a beer! :lol:

8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Problem restore xamp

Postby gakon77 » 10. November 2011 20:28

Hello there,

first of all say that I'm out of my depth here and my understanding of bash is still in diapers.

The file /opt/lampp/share/backup/lampp/backup looks pretty fine to me (may because who doesn't understand doesn't see). :mrgreen:

All the checksums output are ok, so what's next?, check if it's a problem with permissions... Probably that should have been the first step, but why to make things easy if they can be a pain.
Anyway, I did:
Code: Select all
root@debian:~# chmod -R 766 /opt/lampp/
root@debian:~# /opt/lampp/lampp start
Starting XAMPP for Linux 1.7.7...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
Warning: World-writable config file '/opt/lampp/etc/my.cnf' is ignored
XAMPP: Couldn't start MySQL!
XAMPP: Starting ProFTPD...
XAMPP for Linux started.
root@debian:~#

As you can see MySQL doesn't start so I don't know what to do next.

That's my digression. I will keep digging out the permissions issue to see if I get somewhere, because if yours runs smoothly and mine not all I can do is install the 1.7.4 version. :idea:

Cheers mate!
gakon77
 
Posts: 5
Joined: 04. November 2011 08:25
Operating System: Debian 6.0 Squeeze

Re: Problem restore xamp

Postby JonB » 12. November 2011 16:03

Hello again -

Sorry, for the delay. but I have been sick.

About your issue -

1st.

Code: Select all
chmod -R 766 /opt/lampp/


IF you are logged in as root - that should have been unnecessary. But if you need to do that because of how you are editing your files, I think you should only make changes below htdocs, not globally within /opt/lampp.

2nd.

That may or may not have caused the other issue - WHICH IS CAUSING YOUR PROBLEM. MySQL is telling you that!

Code: Select all
Warning: World-writable config file '/opt/lampp/etc/my.cnf' is ignored


read this -

http://hecode.com/how-to-fix-world-writ ... s-ignored/

That chap said it faster than I can type it.

Now - let me say this based on personal experience with XAMMP/LAMPP - Its not a 'regular' LAMP Stack at all. The permissions set during its installation (both ownership {chown} and file mode {chmod}) should not be tinkered with. The reasons are complicated and not 100% understood by yours truly, as I am NOT the one who figured it out originally. As to ownership, 'nobody' should be the owner, and the group should be 'root'. The reason is: 'nobody' is a special user in the Unix filesystem scheme, and if you read through the different scripts, you will find out from the comments how it fits together. The need for the 'root' group (AFAIK) probably goes to the rights being extended to all members of that group (including the user 'root') so Apache can be started. (On *nix systems, ONLY the 'root' user can actually kick-start Apache).

Generally = 755 on folders, 644 on files EXCEPT executable files - (like the LAMPP script) which probably needs to be 775 or 777.

BTW - You probably will find no differences in the 'backup option' scripts between versions, as there is no reason to change the script, that I could think of, other than adding any new configuration files.

I think I have covered it now (mostly at least)

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Problem restore xamp

Postby gakon77 » 02. December 2011 13:27

Back to the issue of backing up XAMPP... Eventually I saw the light :idea:

Because what I wanted was to backup my work done in Drupal, the solution was straight forward - back up drupal and not the whole thing!!!

Therefore, I saved my drupal folder and then the corresponding database with the phpMyAdmin tool.

Piece of cake and problem solved, at least for me.
gakon77
 
Posts: 5
Joined: 04. November 2011 08:25
Operating System: Debian 6.0 Squeeze

Re: Problem restore xamp

Postby JonB » 02. December 2011 17:53

Good thinking -

I use Webmin for my backups, but the principal is the same - I only backup what I am working on regularly. I backup the whole 9 yards once a month.

Good Luck
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Problem restore xamp

Postby timcampanelli » 13. January 2012 17:06

Hello,

I'm running the 1.7.7 version.

I've done a back up of my work and all work just fine.
timcampanelli
 
Posts: 1
Joined: 15. December 2011 19:22
Operating System: win 7

Re: Problem restore xamp

Postby alanbradway » 14. January 2012 00:50

Hello.

When I try to restore I get this:

root@comone:/opt/lampp# sh xampp-backup-03-01-12.sh
xampp-backup-03-01-12.sh: 7: function: not found
egrep: md5sums: No such file or directory

Thanks
alanbradway
 
Posts: 1
Joined: 09. December 2011 17:17
Operating System: win 7

Re: Problem restore xamp

Postby Sharley » 14. January 2012 00:59

timcampanelli and alanbradway are one and the same person. :shock:

Why have you not entered your correct OS in your profile?

Why are you posting contradictory posts in the same topic and showing you are using a Windows OS?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Next

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 37 guests