Forum Moderators: bakedjake

Message Too Old, No Replies

How to compress and backup server?

         

slobizman

10:13 pm on Nov 21, 2003 (gmt 0)

10+ Year Member



I have a managed dedicated server for my site, but I'm not real knowledgeable when it gets to server/unix/apache things. What I want to do is compress (zip?) up my web site, including my two MySQL databases and download them to my local computer.

Is there a script for doing thing somewhere? Or, examples of the commands I'd issue through shell access I can see anywhere? A good reference for this somewhere?

Thanks!

Duckula

11:41 pm on Nov 22, 2003 (gmt 0)

10+ Year Member



Simply tar up the script parts, and use phpmyadmin to export the SQL tables as file. Then use phpmyadmin again in the new machine to import the tables. That's what I do when moving Drupal sites.

moltar

12:00 am on Nov 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There gotta be another way of doing it. I don't believe that server back ups are usually done this way.

I am also interested in the solution.

Duckula

12:18 am on Nov 23, 2003 (gmt 0)

10+ Year Member



Yes; the same operations performed by phpmyadmin can be automated in a script. The GUI is just a more confortable way, to me at least.

I don't do this often, but the idea is using sqldump and sqlrestore. For example:

mysqldump [database name] > [dump file]

and

mysql [database name] < [dump file]

in a shell script, for example.

(I think; I don't do this often, as I said)

<edit>mysqlrestore doesn't exist, sorry</edit>

slobizman

2:26 am on Nov 23, 2003 (gmt 0)

10+ Year Member



I don't even know what tar up files means. I guess it's like a zip for the server, but I've never used it. Do you have a sample command I can see?

Duckula

3:21 am on Nov 23, 2003 (gmt 0)

10+ Year Member



Sorry. Yes, it's like zip.

An example command is, if you want to archive a directory called 'foo/' in the current directory,

tar cjvf foo.tar.bz2 foo/

And to decompress,

tar xjvf foo.tar.bz2

assuming bz2 compression (better, but more CPU expensive).