I have a website that is running on a server. I want to get it down to my local machine so i can edit it without it being like, this means i’ll have to copy the database as well as all the images and HTML, JavaScript, PHP and so on.
My server is running ubuntu server and i am also running ubuntu LAMP on my local machine.
Now i understand that getting all the webpages and images down is simple, just a matter of pulling them down using filezila, but what about the databases?
I know that because its linux everything is stored as a file so would it be a case of be finding the file and copying them to the local machine? If so where would one usually find these files?
thanks a lot for the help, any ideas and tips are more then welcome.
If you want to copy the files, you first have to shut down the database otherwise you could end up with an inconsistent file(s). If the target database is compatible with the file format (eg: same version) this works.
You can dump the databases (with
mysqldumpor a tool like phpmyadmin), and load it on the other machine (mysql <dump.sql). If you want to dump a consistent state, again, you have to either shut down the database or temporary disable writes.