11
ghettonet
Re: Backing it all up
  • 2006/9/5 23:56

  • ghettonet

  • Not too shy to talk

  • Posts: 176

  • Since: 2005/12/4


Ubuntu is awesome, I use regular old Ubuntu myself. I don't know much about Xubuntu itself (i've been using Linux for quite awhile), but i'll assume it's good.

Manually backing up a XOOPS site can be as simple as you want it to be:

First, I always compress the files for my site using the tar command (Apache is setup to serve files from the public_html directory on my server, your mileage may very)

for example, if i had a site called MYSITE, located in the directory /home/MYSITE/public_html/ I would enter:

tar cfvz MYSITE.tar.gz /home/MYSITE/public_html/*

that would create the file MYSITE.tar.gz, which you can copy somewhere (more) secure.

Next, I dump the MySQL database tables. This just takes all the stuff stored in the database and dumps it in a file, so that it can be put back in. Depending on the way MySQL is setup on your machine, you might need to enter the password. This is the command, with the MySQL username being MYUSER, and the database containing the tables for my site is called MYDATABASE:

mysqldump -u MYUSER MYDATABASE > MYDATABASE.sql

This creates the file MYDATABASE.sql - which you should put in the same place as the rest of your backup (the MYSITE.tar.gz from above). **if you need a password in your MySQL setup, the command looks like this:

mysqldump -u MYUSER -p MYDATABASE.sql

That's pretty much it - anything else is just extra to make it either easier, faster, or more secure. Doing this, and sending it to another machine (or burning it to a cd, putting it on a thumbdrive) will keep you pretty safe.

As for how often to backup, I always judge by how often the content on the site changes - you obviously don't need to backup a site once an hour if it only gets 10 posts a day, but if it gets a lot of posts and contains things like development type work, I would backup as much as I possibly could in regards to the system overhead (you don't want your site to be slow because of constant backups.)

*btw - tarring it wouldn't work for a high traffic site, at least not very well, it would be much faster and a ton more efficiant to use the Linux rsync command, but we can cross that bridge when we get to it.

good luck, hope it works out!*/

12
jordi_rc
Re: Backing it all up
  • 2006/9/6 19:30

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


Thanks for this explanation Ghettonet!

My files are in a directory inside

/opt/lampp/htdocs/

As I used XAMPP for setup my web server.

So I suppose I must do:

tar cfvz mysite.tar.gz /opt/lampp/htdocs/mysite/*

Because I have PhPMyAdmin as part of XAMPP, I can use the SQL command you gave me, or use PhPMyAdmin. I read a FAQ in XOOPS site that says this:

----
"MYSQL Backup
You will need to have access to your MySQL database via the phpMyAdmin. Under the main "Welcome to phpMyAdmin" window, you will find the "export" function.
View dump (schema) of databases:
- Select the database you want to backup
- Select SQL
- Select your compression (zipped/gzipped/bzipped)
- Press "Go"
and your database will be downloaded via your web browser to your local computer"
-----

To restore it says:

-----
"Restore your SQL database
In the new site you will need to have access to your mySQL via the "PHPMyAdmin" application again.

Upload the database by opening the "Run SQL query" window. Select the "database backup" zip file and run the query. The database will be created on the new site.
Now you have to create the same MySQL database user as in the old site and give the correct access rights to the user."
-----

Is all this right?

And now some questions more:

1) If I burn a cd with all this, may the permissions of files change to read only? Should I change them after copying from the cd to my linux hard drive. I saw that sometimes the permissions change in a file burned to a cd, and becomes "read only" or "none".
2) If I save all my website directory and the sql file, will I be able to restore it all, or I need to backup something more? I understand that not.
--------------------

Xubuntu is the best Linux I saw. It is really quick and easy. Uses Xfce as desktop and Thunar as explorer.
I tested Debian, and it was a pain to install. Then I tried Ubuntu but I downloaded a corrupted cd image. Finally I found Xubuntu, and it uses really few resources, so it is ideal for server use.
It was really easy to install, and gave no problems.
I recommend it.

Thanks Ghettonet.

Jordi

*/
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR

13
ghettonet
Re: Backing it all up
  • 2006/9/6 22:02

  • ghettonet

  • Not too shy to talk

  • Posts: 176

  • Since: 2005/12/4


Quote:
Is all this right?


Absolutely, phpMyAdmin is just more or less running that sql command. I try not to use phpMyAdmin, because i'm trying to learn more about SQL statements, but definitely use it if you can - it can save you alot of trouble.

Quote:
1) If I burn a cd with all this, may the permissions of files change to read only? Should I change them after copying from the cd to my linux hard drive. I saw that sometimes the permissions change in a file burned to a cd, and becomes "read only" or "none".


Right - the files on a CD will be read only, because you can't write to a cd (well, you can, but not like you write to a hard drive). You will probably have to change them when you take them off the CD and put them on your hard drive. This isn't bad though - just a few commands and your done. I usually just use: chmod -R 755 *

Quote:
chmod -R 755 *


from the top level of your site, the -R makes it recursive, so it will change the permissions of every file underneath. (in your case, you would cd to /opt/lampp/htdocs/ then run it).

then there are the few directories/files that need to be set to other permissions:

Quote:
chmod 444 mainfile.php ; chmod 777 uploads ; chmod 777 cache ; chmod 777 templates_c


(there may be others, depending on which modules you have installed, but those are the really important ones.)

if you run into problems you think might be related to permissions, just remember that for a script to be run by apache, by default, it cannot be writeable (for security reasons) - so all the php scripts, with the exception of mainfile.php, have to be chmodded to 755 in order to be executed.

hope that helps you out

14
jordi_rc
Re: Backing it all up
  • 2006/9/7 21:07

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


Thanks Ghettonet!

You solved all the doubts that I had.



Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR

Login

Who's Online

269 user(s) are online (184 user(s) are browsing Support Forums)


Members: 0


Guests: 269


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits