Help understanding webserver/mysql?

Status
Not open for further replies.

oguruma

Patron
Joined
Jan 2, 2016
Messages
226
I am trying to learn about webservers, specifically for hosting websites using Wordpress CMS. I could use some help checking my understanding on point 1. and some explanation of question 2.

1.
The contents that make up the Wordpress site consist of everything in the /public_html folder and the database. For a typical Wordpress install, all of the themes, plugins, media uploads, etc are in that folder. It would typically be, in a Linux environment, /var/www/html/mywebsite.com/public_html. Is that accurate?

2. I understand that for Wordpress, the users, posts and pages are in the database. Now, what I don't understand is: is there just one database that contains all of this information in various tables?

So, for backing up a Wordpress site, all I need is (other than a compatible server with the right modules) the contents of the /public_html folder and that database? Backing up the contents of public_html is easy enough. But why can't a database be backed up this way? Could I theoretically RSYNC/FTP the database to where I need it? Or is there something about a MySQL database that makes it more complicated than that?

 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
But why can't a database be backed up this way?
A database can be pretty easily backed up using the mysqldump command. But trying to just copy the relevant files from the filesystem is a good way to get yourself a corrupt database.
 

oguruma

Patron
Joined
Jan 2, 2016
Messages
226
A database can be pretty easily backed up using the mysqldump command. But trying to just copy the relevant files from the filesystem is a good way to get yourself a corrupt database.

Thanks for the input. Why is it that a mysql database acts differently than, say a jpeg in terms of its portability?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Because a .jpg typically isn't open in 15 different places at once, all trying to modify it at the same time.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Like @danb35 said you dump the database and backup the database dump. The entire backup process can be accomplished and automated with scripts set up to run via cron tasks.
 
Status
Not open for further replies.
Top