I’m facing huge issue and I need to do an emergency backup which is only can be done through ftp (and ssh also, I think) so if I downloaded all the files in the directory var/www/websitename will that make me with a safe backup? and I can start destroying everything to fix my issues? or my website is not in that directory?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The main location of your websites’ data is defined by your VirtualHost or Server Block, depending on whether you’re using Apache or NGINX. Apache uses VirtualHosts whereas NGINX uses Server Blocks.
For Apache, you’d want to look at the file(s) here:
/etc/apache2/sites-available
For NGINX, you’d want to look at the file(s) here:
/etc/nginx/sites-available
Find the files that are associated with your website(s) and open each file. Within each file you should see DocumentRoot (Apache) or root (NGINX). That’s the base location of where your files should reside, so you’ll want to backup those directories/files.
Additionally, if there files uploaded elsewhere, you’ll want to back those up too.
Keep in mind, those doesn’t backup databases, so if you need to backup MySQL databases too, you’d need to use the CLI or use phpMyAdmin to do so.
The file pertaining to your site in /etc/apache2/sites-available was simply meant to find the location of your files using DocumentRoot as the source (since that’s where you’re telling Apache that your files are).
To backup just your files, you need to backup files/directories inside of the DocumentRoot path as that’s where your files are.
As noted in my previous response though, that doesn’t include databases. You’d need to use either the CLI or a PHP script such as phpMyAdmin and Adminer to backup databases.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.